]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
nvme-multipath: enable PCI P2PDMA for multipath devices
authorKiran Kumar Modukuri <kmodukuri@nvidia.com>
Wed, 13 May 2026 18:51:53 +0000 (11:51 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 May 2026 21:51:48 +0000 (15:51 -0600)
NVMe multipath does not expose BLK_FEAT_PCI_P2PDMA on the head disk
even when all underlying controllers support it.

Set BLK_FEAT_PCI_P2PDMA unconditionally in nvme_mpath_alloc_disk()
alongside the other features.  nvme_update_ns_info_block() already
calls queue_limits_stack_bdev() to stack each path's limits onto the
head disk, which routes through blk_stack_limits().  The core now
clears BLK_FEAT_PCI_P2PDMA automatically if any path (e.g., FC) does
not support it, consistent with how BLK_FEAT_NOWAIT and BLK_FEAT_POLL
are handled.

Tested-by: Pranjal Shrivastava <praan@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com>
Signed-off-by: Kiran Kumar Modukuri <kmodukuri@nvidia.com>
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
Tested=by: Pranjal Shrivastava <praan@google.com>
Link: https://patch.msgid.link/20260513185153.95552-4-kch@nvidia.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/multipath.c

index 263161cb8ac06cf08c5af31573d824eae1cf91d9..ff442bbf2937a2303b9c47e2bc4603a2be1f4ec4 100644 (file)
@@ -730,7 +730,7 @@ int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl, struct nvme_ns_head *head)
        blk_set_stacking_limits(&lim);
        lim.dma_alignment = 3;
        lim.features |= BLK_FEAT_IO_STAT | BLK_FEAT_NOWAIT |
-               BLK_FEAT_POLL | BLK_FEAT_ATOMIC_WRITES;
+               BLK_FEAT_POLL | BLK_FEAT_ATOMIC_WRITES | BLK_FEAT_PCI_P2PDMA;
        if (head->ids.csi == NVME_CSI_ZNS)
                lim.features |= BLK_FEAT_ZONED;