Re: [PATCH v8 23/24] nvme-pci: convert to blk_rq_dma_map

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 22, 2025 at 10:26:06AM +0300, Leon Romanovsky wrote:
> On Tue, Apr 22, 2025 at 07:00:50AM +0200, Christoph Hellwig wrote:
> > > +	dma_len = min_t(u32, length, NVME_CTRL_PAGE_SIZE - (dma_addr & (NVME_CTRL_PAGE_SIZE - 1)));
> > 
> > And overly long line slipped in here during one of the rebases.
> > 
> > > +		/*
> > > +		 * We are in this mode as IOVA path wasn't taken and DMA length
> > > +		 * is morethan two sectors. In such case, mapping was perfoormed
> > > +		 * per-NVME_CTRL_PAGE_SIZE, so unmap accordingly.
> > > +		 */
> > 
> > Where does this comment come from?  Lots of spelling errors, and I
> > also don't understand what it is talking about as setors are entirely
> > irrelevant here.
> 
> I'm trying to say when this do {} while is taken and sector is a wrong
> word to describe NVME_CTRL_PAGE_SIZE. Let's remove this comment.

Yes, I'd say drop it.

> > With the addition of metadata SGL support this also needs to check
> > NVME_CMD_SGL_METASEG.
> > 
> > The commit message should also really mentioned that someone
> > significantly altered the patch for merging with latest upstream,
> > as I as the nominal author can't recognize some of that code.
> 
> Someone :), I thought that adding my SOB is enough.

Well, it also has Chaitanya's, so it must have passed through both of
you at least.  Usually you want to add a little line explaining what you
changed for non-trivial changes when changing it.

>         if (!blk_rq_dma_unmap(req, dev->dev, &iod->dma_meta_state,
>                               iod->total_meta_len)) {
> -               if (entries == 1) {
> +               if (iod->cmd.common.flags & NVME_CMD_SGL_METASEG) {
> +                       unsigned int i;
> +
> +                       for (i = 0; i < entries; i++)
> +                               dma_unmap_page(dev->dev,
> +                                      le64_to_cpu(sg_list[i].addr),
> +                                      le32_to_cpu(sg_list[i].length), dir);
> +               } else {
>                         dma_unmap_page(dev->dev, iod->meta_dma,
> -                                      rq_integrity_vec(req).bv_len,
> -                                      rq_dma_dir(req));
> +                                      rq_integrity_vec(req).bv_len, dir);
>                         return;

It would be nice if we could share a bit of code with the data
mapping, but I'm not sure that's possible.  I'll try to look into
it and review things more carefully once I've reduced my backlog.





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux