linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] nvme-pci: allocate nvme_command within driver pdu
@ 2021-03-16 17:06 Keith Busch
  2021-03-16 17:06 ` [PATCH 2/2] nvme: use driver pdu command for passthrough Keith Busch
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Keith Busch @ 2021-03-16 17:06 UTC (permalink / raw)
  To: linux-nvme, sagi, hch, Kanchan Joshi; +Cc: Keith Busch

All the nvme transport drivers had allocated the nvme command within the
driver's pdu except for pci. Align pci with everyone else and replace
the stack variable with the pdu command.

Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 drivers/nvme/host/pci.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index ecd11b1febf8..1a0912146c74 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -224,6 +224,7 @@ struct nvme_queue {
  */
 struct nvme_iod {
 	struct nvme_request req;
+	struct nvme_command cmd;
 	struct nvme_queue *nvmeq;
 	bool use_sgl;
 	int aborted;
@@ -917,7 +918,7 @@ static blk_status_t nvme_queue_rq(struct blk_mq_hw_ctx *hctx,
 	struct nvme_dev *dev = nvmeq->dev;
 	struct request *req = bd->rq;
 	struct nvme_iod *iod = blk_mq_rq_to_pdu(req);
-	struct nvme_command cmnd;
+	struct nvme_command *cmnd = &iod->cmd;
 	blk_status_t ret;
 
 	iod->aborted = 0;
@@ -931,24 +932,24 @@ static blk_status_t nvme_queue_rq(struct blk_mq_hw_ctx *hctx,
 	if (unlikely(!test_bit(NVMEQ_ENABLED, &nvmeq->flags)))
 		return BLK_STS_IOERR;
 
-	ret = nvme_setup_cmd(ns, req, &cmnd);
+	ret = nvme_setup_cmd(ns, req, cmnd);
 	if (ret)
 		return ret;
 
 	if (blk_rq_nr_phys_segments(req)) {
-		ret = nvme_map_data(dev, req, &cmnd);
+		ret = nvme_map_data(dev, req, cmnd);
 		if (ret)
 			goto out_free_cmd;
 	}
 
 	if (blk_integrity_rq(req)) {
-		ret = nvme_map_metadata(dev, req, &cmnd);
+		ret = nvme_map_metadata(dev, req, cmnd);
 		if (ret)
 			goto out_unmap_data;
 	}
 
 	blk_mq_start_request(req);
-	nvme_submit_cmd(nvmeq, &cmnd, bd->last);
+	nvme_submit_cmd(nvmeq, cmnd, bd->last);
 	return BLK_STS_OK;
 out_unmap_data:
 	nvme_unmap_data(dev, req);
-- 
2.25.4


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

end of thread, other threads:[~2021-03-17 14:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-16 17:06 [PATCH 1/2] nvme-pci: allocate nvme_command within driver pdu Keith Busch
2021-03-16 17:06 ` [PATCH 2/2] nvme: use driver pdu command for passthrough Keith Busch
2021-03-16 17:44   ` Sagi Grimberg
2021-03-16 18:08     ` Keith Busch
2021-03-17  6:47   ` Christoph Hellwig
2021-03-17  9:46   ` Kanchan Joshi
2021-03-17 14:06     ` Keith Busch
2021-03-16 17:44 ` [PATCH 1/2] nvme-pci: allocate nvme_command within driver pdu Sagi Grimberg
2021-03-16 18:02 ` Christoph Hellwig
2021-03-16 18:13   ` Keith Busch
2021-03-16 18:27     ` Sagi Grimberg
2021-03-16 18:34       ` Christoph Hellwig
2021-03-17  6:46 ` Christoph Hellwig

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).