From: Christoph Hellwig <hch@lst.de>
To: Keith Busch <kbusch@kernel.org>
Cc: Leon Romanovsky <leon@kernel.org>, Christoph Hellwig <hch@lst.de>,
Jens Axboe <axboe@kernel.dk>, Jason Gunthorpe <jgg@nvidia.com>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-nvme@lists.infradead.org, Sagi Grimberg <sagi@grimberg.me>
Subject: Re: [PATCH 3/4] block-dma: properly take MMIO path
Date: Wed, 15 Oct 2025 06:18:46 +0200 [thread overview]
Message-ID: <20251015041846.GB7073@lst.de> (raw)
In-Reply-To: <aO1URj3B3IUHX4Ge@kbusch-mbp>
On Mon, Oct 13, 2025 at 01:34:30PM -0600, Keith Busch wrote:
> On Mon, Oct 13, 2025 at 10:29:40PM +0300, Leon Romanovsky wrote:
> > On Mon, Oct 13, 2025 at 01:01:18PM -0600, Keith Busch wrote:
> > > On Mon, Oct 13, 2025 at 06:34:11PM +0300, Leon Romanovsky wrote:
> > > > static bool blk_dma_map_direct(struct request *req, struct device *dma_dev,
> > > > struct blk_dma_iter *iter, struct phys_vec *vec)
> > > > {
> > > > + unsigned int attrs = 0;
> > > > +
> > > > + if (req->cmd_flags & REQ_MMIO)
> > > > + attrs |= DMA_ATTR_MMIO;
> > >
> > > Since data and integrity paylods use these same functions and may point
> > > to different kinds of memory, I think you'd have to pass the 'attrs'
> > > from the caller since it knows which flags to check for MMIO dma.
> >
> > I think that hunk will fix it.
> >
> > diff --git a/block/blk-mq-dma.c b/block/blk-mq-dma.c
> > index 38f5c34ca223..8af88ba97c7a 100644
> > --- a/block/blk-mq-dma.c
> > +++ b/block/blk-mq-dma.c
> > @@ -88,9 +88,11 @@ static bool blk_dma_map_bus(struct blk_dma_iter *iter, struct phys_vec *vec)
> > static bool blk_dma_map_direct(struct request *req, struct device *dma_dev,
> > struct blk_dma_iter *iter, struct phys_vec *vec)
> > {
> > + struct bio_integrity_payload *bip = bio_integrity(req->bio);
> > unsigned int attrs = 0;
> >
> > - if (req->cmd_flags & REQ_MMIO)
> > + if ((!bip && req->cmd_flags & REQ_MMIO) ||
> > + bio_integrity_flagged(req->bio, BIP_MMIO))
> > attrs |= DMA_ATTR_MMIO;
>
> If cmd_flags has REQ_MMIO set, but the integrity flag doesn't have
> BIP_MMIO set, you will skip setting DMA_ATTR_MMIO, but I think we need
> that set when this is called for the data payload.
Yes, we just need to check the relevant flag in the caller
and pass it in. Or maybe just stash it in struct blk_dma_iter.
next prev parent reply other threads:[~2025-10-15 4:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-13 15:34 [PATCH 0/4] Properly " Leon Romanovsky
2025-10-13 15:34 ` [PATCH 1/4] blk-mq-dma: migrate to dma_map_phys instead of map_page Leon Romanovsky
2025-10-15 4:16 ` Christoph Hellwig
2025-10-13 15:34 ` [PATCH 2/4] blk-mq-dma: unify DMA unmap routine Leon Romanovsky
2025-10-13 18:53 ` Keith Busch
2025-10-13 19:35 ` Leon Romanovsky
2025-10-13 15:34 ` [PATCH 3/4] block-dma: properly take MMIO path Leon Romanovsky
2025-10-13 19:01 ` Keith Busch
2025-10-13 19:29 ` Leon Romanovsky
2025-10-13 19:34 ` Keith Busch
2025-10-15 4:18 ` Christoph Hellwig [this message]
2025-10-13 15:34 ` [PATCH 4/4] nvme-pci: unmap MMIO pages with appropriate interface Leon Romanovsky
2025-10-15 4:20 ` Christoph Hellwig
2025-10-15 6:44 ` Leon Romanovsky
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=20251015041846.GB7073@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=jgg@nvidia.com \
--cc=kbusch@kernel.org \
--cc=leon@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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
all inboxes | Powered by JetHome®