Skip to contentSkip to conversation

nvme-pci: fix missed admin queue sq doorbell write

PATCH In review Keith Busch 4 participants 4 messages Apr 21 – Apr 22 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-pci: fix missed admin queue sq doorbell write

From: Keith Busch <[email protected]>

We can batch admin commands, which means bd->last may be false, skipping the doorbell write so that we aggregate multiple commands per write. If a subsequent command can't be dispatched for whatever reason, we have to provide the blk-mq ops' commit_rqs callback in order to ensure we properly update the doorbell.

Fixes 58e5bdeb9c2b ("nvme: enable uring-passthrough for admin commands")
---
 drivers/nvme/host/pci.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nvme/host/pci.c +1 -0
index db5fc9bf66272..4c052ed18cb8d 100644
@@ -2241,6 +2241,7 @@ static int nvme_create_queue(struct nvme_queue *nvmeq, int qid, bool polled)
 static const struct blk_mq_ops nvme_mq_admin_ops = {
 	.queue_rq	= nvme_queue_rq,
 	.complete	= nvme_pci_complete_rq,
+	.commit_rqs	= nvme_commit_rqs,
 	.init_hctx	= nvme_admin_init_hctx,
 	.init_request	= nvme_pci_init_request,
 	.timeout	= nvme_timeout,
Signature · 1 line
2.52.0
maintainer
#2 lore raw
Quoted 7 lines · Christoph Hellwig
Quoted 3 lines · Keith Busch

From: Keith Busch <[email protected]>

We can batch admin commands, which means bd->last may be false,

How do we end up batching them? io_uring passthrough I guess? Can you expand the commit log a bit with that?

Exactly, io_uring_cmd passthrough starts a plug. The "Fixes" tag is a bit subtle, so I'll more explicitly state this in the commit message.