[PATCH 2/4] blk-mq-dma: unify DMA unmap routine

Leon Romanovsky leon at kernel.org
Mon Oct 13 12:35:25 PDT 2025


On Mon, Oct 13, 2025 at 12:53:47PM -0600, Keith Busch wrote:
> On Mon, Oct 13, 2025 at 06:34:10PM +0300, Leon Romanovsky wrote:
> > +bool blk_rq_dma_unmap(struct request *req, struct device *dma_dev,
> > +		struct dma_iova_state *state, size_t mapped_len)
> > +{
> > +	struct bio_integrity_payload *bip = bio_integrity(req->bio);
> > +
> > +	if ((!bip && req->cmd_flags & REQ_P2PDMA) ||
> > +	    bio_integrity_flagged(req->bio, BIP_P2P_DMA))
> > +		return true;
> 
> I don't think you can unify it at this part here because the data
> payload might not be P2P but the integrity payload could be. The data
> payload needs to proceed to the next unmapping step in that case, but
> this change would have it return true early.

I was under wrong impression that request has or data payload or
integrity, but never both :(.

Thanks



More information about the Linux-nvme mailing list