md: propagate BLK_FEAT_PCI_P2PDMA from member devices to RAID device
authorKiran Kumar Modukuri <kmodukuri@nvidia.com>
Wed, 13 May 2026 18:51:52 +0000 (11:51 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 May 2026 21:51:48 +0000 (15:51 -0600)
commit02666132403aec8fc5de315002894f713ef17dbc
tree14f6e429b562840e927279f093400feef9f08c6f
parent7882834048f110931275357db60dccff906dc96a
md: propagate BLK_FEAT_PCI_P2PDMA from member devices to RAID device

MD RAID does not propagate BLK_FEAT_PCI_P2PDMA from member devices to
the RAID device, preventing peer-to-peer DMA through the RAID layer even
when all underlying devices support it.

Enable BLK_FEAT_PCI_P2PDMA unconditionally in raid0, raid1 and raid10
personalities during queue limits setup.  blk_stack_limits() clears it
automatically if any member device lacks support, consistent with how
BLK_FEAT_NOWAIT and BLK_FEAT_POLL are handled in the block core.

Parity RAID personalities (raid4/5/6) are excluded because they require
CPU access to data pages for parity computation, which is incompatible
with P2P mappings.

Tested with RAID0/1/10 arrays containing multiple NVMe devices with
P2PDMA support, confirming that peer-to-peer transfers work correctly
through the RAID layer.

Tested-by: Pranjal Shrivastava <praan@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Kiran Kumar Modukuri <kmodukuri@nvidia.com>
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Yu Kuai <yukuai@fygo.io>
Tested=by: Pranjal Shrivastava <praan@google.com>
Link: https://patch.msgid.link/20260513185153.95552-3-kch@nvidia.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/raid0.c
drivers/md/raid1.c
drivers/md/raid10.c