From: Christoph Hellwig <hch@lst.de>
To: Keith Busch <kbusch@meta.com>
Cc: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org,
hch@lst.de, axboe@kernel.dk, leonro@nvidia.com,
Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCHv2 6/7] blk-mq-dma: add support for mapping integrity metadata
Date: Mon, 21 Jul 2025 09:46:58 +0200 [thread overview]
Message-ID: <20250721074658.GG32034@lst.de> (raw)
In-Reply-To: <20250720184040.2402790-7-kbusch@meta.com>
On Sun, Jul 20, 2025 at 11:40:39AM -0700, Keith Busch wrote:
> +static bool blk_dma_iter_next(struct blk_dma_iter *iter)
This is at the blk_map_iter level and one level below dma, so it
should not have a dma in the name. I'm not entirely sure what a good
name is, though. Maybe blk_map_iter_next_bio wich was the original
intention behind the refactored loop, although it isn't quite true
with the later !iter->iter.bi_bvec_done addition.
> +#ifdef CONFIG_BLK_DEV_INTEGRITY
> +bool blk_rq_integrity_dma_map_iter_start(struct request *req,
> + struct device *dma_dev, struct dma_iova_state *state,
> + struct blk_dma_iter *iter)
> +{
> + unsigned len = bio_integrity_bytes(&req->q->limits.integrity,
> + blk_rq_sectors(req));
> + iter->iter = req->bio->bi_integrity->bip_iter;
> + iter->bvec = req->bio->bi_integrity->bip_vec;
> + iter->integrity = true;
> + return blk_dma_map_iter_start(req, dma_dev, state, iter, len);
> +}
> +EXPORT_SYMBOL_GPL(blk_rq_integrity_dma_map_iter_start);
> +
> +bool blk_rq_integrity_dma_map_iter_next(struct request *req,
> + struct device *dma_dev, struct blk_dma_iter *iter)
The wans kernel doc comments that can be mostly copy and pasted
from the data mapping version.
Also it would be great to convert the integrity sg mapping and
count macros to blk_dma_map_iter_ just like I did for the data
version.
> +bool blk_rq_integrity_dma_map_iter_start(struct request *req,
> + struct device *dma_dev, struct dma_iova_state *state,
> + struct blk_dma_iter *iter)
> +{
> + return false;
> +}
> +bool blk_rq_integrity_dma_map_iter_next(struct request *req,
As you've probably noticed from the buildbot these need to be inline.
> @@ -18,6 +18,7 @@ struct blk_dma_iter {
> struct bvec_iter iter;
> struct bio *bio;
> struct pci_p2pdma_map_state p2pdma;
> + bool integrity;
Add an is_ prefix for the new field? Or replace it with checks
for ->bvec (or ->bvec_table as it should be) != bio->bi_io_vec?
next prev parent reply other threads:[~2025-07-21 7:47 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-20 18:40 [PATCHv2 0/7] blk dma iter for metadata Keith Busch
2025-07-20 18:40 ` [PATCHv2 1/7] blk-mq-dma: move the bio and bvec_iter to blk_dma_iter Keith Busch
2025-07-21 7:37 ` Christoph Hellwig
2025-07-21 7:42 ` Christoph Hellwig
2025-07-22 2:33 ` Keith Busch
2025-07-22 5:53 ` Christoph Hellwig
2025-07-20 18:40 ` [PATCHv2 2/7] blk-mq-dma: set the bvec being iterated Keith Busch
2025-07-21 7:38 ` Christoph Hellwig
2025-07-20 18:40 ` [PATCHv2 3/7] blk-mq-dma: require unmap caller provide p2p map type Keith Busch
2025-07-21 7:39 ` Christoph Hellwig
2025-07-20 18:40 ` [PATCHv2 4/7] blk-mq: remove REQ_P2PDMA flag Keith Busch
2025-07-21 7:39 ` Christoph Hellwig
2025-07-20 18:40 ` [PATCHv2 5/7] blk-mq-dma: move common dma start code to a helper Keith Busch
2025-07-21 7:40 ` Christoph Hellwig
2025-07-20 18:40 ` [PATCHv2 6/7] blk-mq-dma: add support for mapping integrity metadata Keith Busch
2025-07-20 22:51 ` kernel test robot
2025-07-21 3:18 ` kernel test robot
2025-07-21 7:46 ` Christoph Hellwig [this message]
2025-07-20 18:40 ` [PATCHv2 7/7] nvme: convert metadata mapping to dma iter Keith Busch
2025-07-21 7:50 ` Christoph Hellwig
2025-07-21 13:15 ` Keith Busch
2025-07-22 5:49 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250721074658.GG32034@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=kbusch@kernel.org \
--cc=kbusch@meta.com \
--cc=leonro@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox