Skip to contentSkip to conversation

block: add bi_crypto_ctx variable in struct bio

PATCH In review Parshuram Thombare 2 participants 3 messages Dec 11, 2018 – Dec 12, 2018 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 block: add bi_crypto_ctx variable in struct bio

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.

---
 include/linux/blk_types.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
include/linux/blk_types.h +4 -0
index 1dcf652..bd77603 100644
@@ -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 */
 
 	/*
Signature · 1 line
1.7.1
maintainer
#1 lore raw
Quoted 14 lines · Parshuram Thombare

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.

---
 include/linux/blk_types.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
include/linux/blk_types.h +0 -0
index 1dcf652..bd77603 100644

include/linux/blk_types.h struct bio { · line 197

Quoted 10 lines
include/linux/blk_types.h +4 -0
@@ -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.

Signature · 1 line
Jens Axboe
#2 lore raw

Hello Jens,

Thank you for a comment.

Quoted 38 lines

-----Original Message-----
From: Jens Axboe <[email protected]>
Sent: Tuesday, December 11, 2018 7:07 PM
To: Parshuram Raju Thombare <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: Alan Douglas <[email protected]>; Janek Kotas <[email protected]>; Rafal Ciepiela <[email protected]>
Subject: Re: [PATCH 1/2] block: add bi_crypto_ctx variable in struct bio

EXTERNAL MAIL

Quoted 23 lines · Parshuram Thombare

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.

---
 include/linux/blk_types.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
include/linux/blk_types.h +4 -0
index 1dcf652..bd77603 100644
@@ -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 */
 
Quoted 8 lines

include/linux/blk_types.h struct bio { · line 197

Quoted 1 line
include/linux/blk_types.h +0 -0
 	/*

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.

Quoted 3 lines

--
Jens Axboe

Regards,
Parshuram Thombare