linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvme: set dma alignment to qword
@ 2020-05-21  2:22 Keith Busch
  2020-05-21  6:05 ` Sagi Grimberg
  2020-05-26 14:53 ` Christoph Hellwig
  0 siblings, 2 replies; 8+ messages in thread
From: Keith Busch @ 2020-05-21  2:22 UTC (permalink / raw)
  To: linux-nvme, hch, sagi; +Cc: Keith Busch

The default dma alignment mask is 511, which is much larger than any nvme
controller requires. NVMe controllers accept qword aligned DMA addresses,
so set the request_queue constraints to that. This can help avoid bounce
buffers on user passthrough commands.

Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 drivers/nvme/host/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 805d289e6cd9..ba860efd250d 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2283,6 +2283,7 @@ static void nvme_set_queue_limits(struct nvme_ctrl *ctrl,
 		blk_queue_max_segments(q, min_t(u32, max_segments, USHRT_MAX));
 	}
 	blk_queue_virt_boundary(q, ctrl->page_size - 1);
+	blk_queue_dma_alignment(q, 7);
 	if (ctrl->vwc & NVME_CTRL_VWC_PRESENT)
 		vwc = true;
 	blk_queue_write_cache(q, vwc, vwc);
-- 
2.24.1


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

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

end of thread, other threads:[~2020-05-26 14:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21  2:22 [PATCH] nvme: set dma alignment to qword Keith Busch
2020-05-21  6:05 ` Sagi Grimberg
2020-05-21 15:28   ` Keith Busch
2020-05-21 15:29     ` Christoph Hellwig
2020-05-21 15:41       ` Keith Busch
2020-05-21 15:42         ` Christoph Hellwig
2020-05-21 19:46           ` James Smart
2020-05-26 14:53 ` 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).