mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
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>
This commit is contained in:
parent
7882834048
commit
0266613240
|
|
@ -392,6 +392,7 @@ static int raid0_set_limits(struct mddev *mddev)
|
|||
lim.io_opt = lim.io_min * mddev->raid_disks;
|
||||
lim.chunk_sectors = mddev->chunk_sectors;
|
||||
lim.features |= BLK_FEAT_ATOMIC_WRITES;
|
||||
lim.features |= BLK_FEAT_PCI_P2PDMA;
|
||||
err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY);
|
||||
if (err)
|
||||
return err;
|
||||
|
|
|
|||
|
|
@ -3208,6 +3208,7 @@ static int raid1_set_limits(struct mddev *mddev)
|
|||
lim.max_hw_wzeroes_unmap_sectors = 0;
|
||||
lim.logical_block_size = mddev->logical_block_size;
|
||||
lim.features |= BLK_FEAT_ATOMIC_WRITES;
|
||||
lim.features |= BLK_FEAT_PCI_P2PDMA;
|
||||
err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY);
|
||||
if (err)
|
||||
return err;
|
||||
|
|
|
|||
|
|
@ -3941,6 +3941,7 @@ static int raid10_set_queue_limits(struct mddev *mddev)
|
|||
lim.chunk_sectors = mddev->chunk_sectors;
|
||||
lim.io_opt = lim.io_min * raid10_nr_stripes(conf);
|
||||
lim.features |= BLK_FEAT_ATOMIC_WRITES;
|
||||
lim.features |= BLK_FEAT_PCI_P2PDMA;
|
||||
err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY);
|
||||
if (err)
|
||||
return err;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user