aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorKeith Busch <kbusch@kernel.org>2025-09-03 12:33:17 -0700
committerJens Axboe <axboe@kernel.dk>2025-09-09 10:33:35 -0600
commitd57447ffb5fadffdba920f2fb933296fb6c5ff57 (patch)
treedbd4a5c9aab4476d8e7420cae87090c767354775 /block
parentblk-integrity: enable p2p source and destination (diff)
downloadlinux-d57447ffb5fadffdba920f2fb933296fb6c5ff57.tar.gz
linux-d57447ffb5fadffdba920f2fb933296fb6c5ff57.zip
blk-mq-dma: bring back p2p request flags
We only need to consider data and metadata dma mapping types separately. The request and bio integrity payload have enough flag bits to internally track the mapping type for each. Use these so the caller doesn't need to track them, and provide separete request and integrity helpers to the common code. This will make it easier to scale new mappings, like the proposed MMIO attribute, without burdening the caller to track such things. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Keith Busch <kbusch@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq-dma.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/block/blk-mq-dma.c b/block/blk-mq-dma.c
index 660b5e200ccf..449950029872 100644
--- a/block/blk-mq-dma.c
+++ b/block/blk-mq-dma.c
@@ -174,6 +174,10 @@ static bool blk_dma_map_iter_start(struct request *req, struct device *dma_dev,
switch (pci_p2pdma_state(&iter->p2pdma, dma_dev,
phys_to_page(vec.paddr))) {
case PCI_P2PDMA_MAP_BUS_ADDR:
+ if (iter->iter.is_integrity)
+ bio_integrity(req->bio)->bip_flags |= BIP_P2P_DMA;
+ else
+ req->cmd_flags |= REQ_P2PDMA;
return blk_dma_map_bus(iter, &vec);
case PCI_P2PDMA_MAP_THRU_HOST_BRIDGE:
/*