linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] block: add bi_crypto_ctx variable in struct bio
@ 2018-12-11  9:50 Parshuram Thombare
  2018-12-11 13:37 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Parshuram Thombare @ 2018-12-11  9:50 UTC (permalink / raw)
  To: axboe, tj, jbacik, michaelcallahan, snitzer, osandov,
	keith.busch, ming.lei, shli, dennisszhou, linux-kernel
  Cc: adouglas, jank, rafalc, pthombar

Add variable 'void *bi_crypt_ctx' in 'struct bio'. This will
be used to associate bio with crypto configuration of controller
supporting real time / inline encryption/decryption.

Signed-off-by: Parshuram Thombare <pthombar@cadence.com>
---
 include/linux/blk_types.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 1dcf652..bd77603 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -188,6 +188,10 @@ struct bio {
 #endif
 	};
 
+#ifdef CONFIG_BLK_DEV_HW_RT_ENCRYPTION
+	void *bi_crypto_ctx;
+#endif
+
 	unsigned short		bi_vcnt;	/* how many bio_vec's */
 
 	/*
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] block: add bi_crypto_ctx variable in struct bio
  2018-12-11  9:50 [PATCH 1/2] block: add bi_crypto_ctx variable in struct bio Parshuram Thombare
@ 2018-12-11 13:37 ` Jens Axboe
  2018-12-12  5:34   ` Parshuram Raju Thombare
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2018-12-11 13:37 UTC (permalink / raw)
  To: Parshuram Thombare, tj, jbacik, michaelcallahan, snitzer,
	osandov, keith.busch, ming.lei, shli, dennisszhou, linux-kernel
  Cc: adouglas, jank, rafalc

On 12/11/18 2:50 AM, Parshuram Thombare wrote:
> Add variable 'void *bi_crypt_ctx' in 'struct bio'. This will
> be used to associate bio with crypto configuration of controller
> supporting real time / inline encryption/decryption.
> 
> Signed-off-by: Parshuram Thombare <pthombar@cadence.com>
> ---
>  include/linux/blk_types.h |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
> index 1dcf652..bd77603 100644
> --- a/include/linux/blk_types.h
> +++ b/include/linux/blk_types.h
> @@ -188,6 +188,10 @@ struct bio {
>  #endif
>  	};
>  
> +#ifdef CONFIG_BLK_DEV_HW_RT_ENCRYPTION
> +	void *bi_crypto_ctx;
> +#endif
> +
>  	unsigned short		bi_vcnt;	/* how many bio_vec's */
>  
>  	/*

Pretty sure I mentioned this last time, but in case I didn't, don't
add bio members for random drivers. Can you imagine how huge
this thing would be if we allowed that?

If you need per-io storage, put it in the payload for the blk-mq
request. That way you are only bloating your own IO related data
structures, not everyones.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH 1/2] block: add bi_crypto_ctx variable in struct bio
  2018-12-11 13:37 ` Jens Axboe
@ 2018-12-12  5:34   ` Parshuram Raju Thombare
  0 siblings, 0 replies; 3+ messages in thread
From: Parshuram Raju Thombare @ 2018-12-12  5:34 UTC (permalink / raw)
  To: Jens Axboe, tj, jbacik, michaelcallahan, snitzer, osandov,
	keith.busch, ming.lei, shli, dennisszhou, linux-kernel
  Cc: Alan Douglas, Janek Kotas, Rafal Ciepiela

Hello Jens,

Thank you for a comment.

>-----Original Message-----
>From: Jens Axboe <axboe@kernel.dk>
>Sent: Tuesday, December 11, 2018 7:07 PM
>To: Parshuram Raju Thombare <pthombar@cadence.com>; tj@kernel.org;
>jbacik@fb.com; michaelcallahan@fb.com; snitzer@redhat.com;
>osandov@fb.com; keith.busch@intel.com; ming.lei@redhat.com; shli@fb.com;
>dennisszhou@gmail.com; linux-kernel@vger.kernel.org
>Cc: Alan Douglas <adouglas@cadence.com>; Janek Kotas <jank@cadence.com>;
>Rafal Ciepiela <rafalc@cadence.com>
>Subject: Re: [PATCH 1/2] block: add bi_crypto_ctx variable in struct bio
>
>EXTERNAL MAIL
>
>
>On 12/11/18 2:50 AM, Parshuram Thombare wrote:
>> Add variable 'void *bi_crypt_ctx' in 'struct bio'. This will be used
>> to associate bio with crypto configuration of controller supporting
>> real time / inline encryption/decryption.
>>
>> Signed-off-by: Parshuram Thombare <pthombar@cadence.com>
>> ---
>>  include/linux/blk_types.h |    4 ++++
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
>> index 1dcf652..bd77603 100644
>> --- a/include/linux/blk_types.h
>> +++ b/include/linux/blk_types.h
>> @@ -188,6 +188,10 @@ struct bio {
>>  #endif
>>  	};
>>
>> +#ifdef CONFIG_BLK_DEV_HW_RT_ENCRYPTION
>> +	void *bi_crypto_ctx;
>> +#endif
>> +
>>  	unsigned short		bi_vcnt;	/* how many bio_vec's */
>>
>>  	/*
>
>Pretty sure I mentioned this last time, but in case I didn't, don't add bio members
>for random drivers. Can you imagine how huge this thing would be if we allowed
>that?
>
>If you need per-io storage, put it in the payload for the blk-mq request. That way
>you are only bloating your own IO related data structures, not everyones.
Ok, I will look into using payload for the blk-mq request instead of adding variable 
in struct bio.
I thought this filed would be useful in enabling inline encryption for other type of
devices too.
>
>--
>Jens Axboe

Regards,
Parshuram Thombare

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-12  5:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-11  9:50 [PATCH 1/2] block: add bi_crypto_ctx variable in struct bio Parshuram Thombare
2018-12-11 13:37 ` Jens Axboe
2018-12-12  5:34   ` Parshuram Raju Thombare

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).