Skip to contentSkip to conversation

nvmet: handle rw's limited retry flag

PATCH Superseded Guixin Liu 3 participants 6 messages Nov 21, 2024 – Nov 25, 2024

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Guixin Liu

author
#0 lore raw

PATCH 1/1 nvmet: handle rw's limited retry flag

When the nvme target receive an rw command with limited retry flag, handle it in block backend by setting the REQ_FAILFAST_DEV flag to bio.

---
 drivers/nvme/target/io-cmd-bdev.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/nvme/target/io-cmd-bdev.c +3 -0
index 0bda83d0fc3e..6380b60fd490 100644
@@ -272,6 +272,9 @@ static void nvmet_bdev_execute_rw(struct nvmet_req *req)
 		iter_flags = SG_MITER_FROM_SG;
 	}
 
+	if (req->cmd->rw.control & NVME_RW_LR)
+		opf |= REQ_FAILFAST_DEV;
+
 	if (is_pci_p2pdma_page(sg_page(req->sg)))
 		opf |= REQ_NOMERGE;
 
Signature · 1 line
2.43.0
#2 lore raw
In reply to Guixin Liu
Quoted 3 lines · Guixin Liu

When the nvme target receive an rw command with limited retry flag, handle it in block backend by setting the REQ_FAILFAST_DEV flag to bio.

Do you have a use case where this makes a difference?

The code itself looks fine, but I doubt it's actually useful.

author
#3 lore raw
Quoted 7 lines · Christoph Hellwig
Quoted 3 lines · Guixin Liu

When the nvme target receive an rw command with limited retry flag, handle it in block backend by setting the REQ_FAILFAST_DEV flag to bio.

Do you have a use case where this makes a difference?

The code itself looks fine, but I doubt it's actually useful.

In our scenario, our multipath setup places the REQ_FAILFAST_DEV flag on I/O to prevent

retries and immediately switch to other paths for issuing I/O commands. This will reflect

on the NVMe read and write commands with the limited retry flag. However, the current

NVMe target side does not handle the limited retry flag, and the target's underlying

driver still retries the I/O. I believe this will result in the I/O not being quickly

switched to other paths, ultimately leading to increased I/O latency.

Best Regards,

Guixin Liu

author
#5 lore raw
Quoted 1 line · Christoph Hellwig

Can you add this to the commit log, please?

Sure, I will send a v2 patch.

Best Regards,

Guixin Liu