Thread (23 messages) 23 messages, 8 authors, 2025-06-04

Re: [PATCH v11 07/10] block: introduce BIP_CHECK_GUARD/REFTAG/APPTAG bip_flags

From: Anuj Gupta <hidden>
Date: 2025-02-05 12:26:44
Also in: io-uring, linux-fsdevel, linux-nvme, linux-scsi
Subsystem: nvm express target driver, the rest · Maintainers: Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni, Linus Torvalds

On Tue, Feb 04, 2025 at 06:39:14AM +0100, Christoph Hellwig wrote:
On Mon, Feb 03, 2025 at 08:09:48PM +0530, Anuj Gupta wrote:
quoted
+	if (bi->csum_type == BLK_INTEGRITY_CSUM_IP)
+		bip->bip_flags |= BIP_IP_CHECKSUM;
We'll also need to set the BIP_CHECK_GUARD flag here I think.
Right, I think this patch should address the problem [*]
I couldn't test this patch, as nvme-tcp doesn't support T10-PI and so
does rdma_rxe. I don't have rdma h/w to test this.
It would be great if someone can give this a run.

[*]

Subject: [PATCH] nvmet: set bip_flags to specify integrity checks

A recent patch [1] changed how the driver sets checks for integrity buffer.
The checks are now specified via newly introduced bip_flags that indicate
how to check the integrity payload. nvme target never sets these flags.
Modify it, so that it starts using these new bip_flags.

[1] https://lore.kernel.org/linux-nvme/20241128112240.8867-8-anuj20.g@samsung.com/ (local)

Signed-off-by: Anuj Gupta <redacted>
---
 drivers/nvme/target/io-cmd-bdev.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd-bdev.c
index c1f574fe3280..4bab24bcd6e8 100644
--- a/drivers/nvme/target/io-cmd-bdev.c
+++ b/drivers/nvme/target/io-cmd-bdev.c
@@ -210,6 +210,10 @@ static int nvmet_bdev_alloc_bip(struct nvmet_req *req, struct bio *bio,
 		return PTR_ERR(bip);
 	}
 
+	if (bi->csum_type)
+		bip->bip_flags |= BIP_CHECK_GUARD;
+	if (bi->flags & BLK_INTEGRITY_REF_TAG)
+		bip->bip_flags |= BIP_CHECK_REFTAG;
 	/* virtual start sector must be in integrity interval units */
 	bip_set_seed(bip, bio->bi_iter.bi_sector >>
 		     (bi->interval_exp - SECTOR_SHIFT));
-- 
2.25.1

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help