public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/1] nvme-pci: set virt boundary according to capability
@ 2025-12-08 22:26 Max Gurtovoy
  2025-12-09  6:40 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Max Gurtovoy @ 2025-12-08 22:26 UTC (permalink / raw)
  To: sagi, linux-nvme, kbusch, hch; +Cc: kch, axboe, linux-block, Max Gurtovoy

Some controllers advertise DWORD alignment for SGLs, so configure the
virtual boundary correctly for those devices.

Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
 drivers/nvme/host/pci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index e5ca8301bb8b..eacc89cd25eb 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -3326,7 +3326,9 @@ static unsigned long nvme_pci_get_virt_boundary(struct nvme_ctrl *ctrl,
 {
 	if (!nvme_ctrl_sgl_supported(ctrl) || is_admin)
 		return NVME_CTRL_PAGE_SIZE - 1;
-	return 0;
+	else if (ctrl->sgls & NVME_CTRL_SGLS_BYTE_ALIGNED)
+		return 0;
+	return 3;
 }
 
 static const struct nvme_ctrl_ops nvme_pci_ctrl_ops = {
-- 
2.43.5



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

end of thread, other threads:[~2025-12-10 11:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-08 22:26 [PATCH 1/1] nvme-pci: set virt boundary according to capability Max Gurtovoy
2025-12-09  6:40 ` Christoph Hellwig
2025-12-09 11:31   ` Max Gurtovoy
2025-12-10 11:28     ` Keith Busch
2025-12-10 11:44       ` Max Gurtovoy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox