All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Maor Gottlieb <maorg@nvidia.com>
Cc: dledford@redhat.com, hch@infradead.org, leonro@nvidia.com,
	aelior@marvell.com, daniel@ffwll.ch, airlied@linux.ie,
	dennis.dalessandro@cornelisnetworks.com,
	dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com,
	linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	mkalderon@marvell.com, mike.marciniszyn@cornelisnetworks.com,
	mustafa.ismail@intel.com, rodrigo.vivi@intel.com,
	sroland@vmware.com, shiraz.saleem@intel.com, tzimmermann@suse.de,
	linux-graphics-maintainer@vmware.com, liweihang@huawei.com,
	liangwenpeng@huawei.com, yishaih@nvidia.com, zackr@vmware.com,
	zyjzyj2000@gmail.com
Subject: Re: [PATCH rdma-next v4 2/3] lib/scatterlist: Fix wrong update of orig_nents
Date: Wed, 25 Aug 2021 10:09:23 -0300	[thread overview]
Message-ID: <20210825130923.GF1721383@nvidia.com> (raw)
In-Reply-To: <4f4a712a-71d4-ebac-48f2-766bfda61f1e@nvidia.com>

On Wed, Aug 25, 2021 at 07:59:27AM +0300, Maor Gottlieb wrote:
> 
> On 8/24/2021 10:12 PM, Jason Gunthorpe wrote:
> > On Tue, Aug 24, 2021 at 05:25:30PM +0300, Maor Gottlieb wrote:
> > > @@ -514,11 +531,13 @@ struct scatterlist *sg_alloc_append_table_from_pages(struct sg_table *sgt,
> > >   		offset = 0;
> > >   		cur_page = j;
> > >   	}
> > > -	sgt->nents += added_nents;
> > > +	sgt_append->sgt.nents += added_nents;
> > > +	sgt_append->sgt.orig_nents = sgt_append->sgt.nents;
> > > +	sgt_append->prv = s;
> > Why is nents being touched here?
> > 
> > Shouldn't it just be
> > 
> >      sgt_append->sgt.orig_nents += added_nents;
> >      sgt_append->prv = s;
> > 
> > ?
> 
> In general yes, but all the sg_alloc_* functions update both
> orig_nents and nents (to same value). May be drivers that pass nents
> instead of orig_nents to dma_map_sg* (like umem did before this
> patch set). So I prefer to set it here as well, also not to break
> sg_alloc_table_from_pages_segment which use the same path. This kind
> of change could be done very carefully next cycle for all
> sg_alloc_*.

Ok, interesting

Jason

WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@nvidia.com>
To: Maor Gottlieb <maorg@nvidia.com>
Cc: dledford@redhat.com, hch@infradead.org, leonro@nvidia.com,
	aelior@marvell.com, daniel@ffwll.ch, airlied@linux.ie,
	dennis.dalessandro@cornelisnetworks.com,
	dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com,
	linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	mkalderon@marvell.com, mike.marciniszyn@cornelisnetworks.com,
	mustafa.ismail@intel.com, rodrigo.vivi@intel.com,
	sroland@vmware.com, shiraz.saleem@intel.com, tzimmermann@suse.de,
	linux-graphics-maintainer@vmware.com, liweihang@huawei.com,
	liangwenpeng@huawei.com, yishaih@nvidia.com, zackr@vmware.com,
	zyjzyj2000@gmail.com
Subject: Re: [Intel-gfx] [PATCH rdma-next v4 2/3] lib/scatterlist: Fix wrong update of orig_nents
Date: Wed, 25 Aug 2021 10:09:23 -0300	[thread overview]
Message-ID: <20210825130923.GF1721383@nvidia.com> (raw)
In-Reply-To: <4f4a712a-71d4-ebac-48f2-766bfda61f1e@nvidia.com>

On Wed, Aug 25, 2021 at 07:59:27AM +0300, Maor Gottlieb wrote:
> 
> On 8/24/2021 10:12 PM, Jason Gunthorpe wrote:
> > On Tue, Aug 24, 2021 at 05:25:30PM +0300, Maor Gottlieb wrote:
> > > @@ -514,11 +531,13 @@ struct scatterlist *sg_alloc_append_table_from_pages(struct sg_table *sgt,
> > >   		offset = 0;
> > >   		cur_page = j;
> > >   	}
> > > -	sgt->nents += added_nents;
> > > +	sgt_append->sgt.nents += added_nents;
> > > +	sgt_append->sgt.orig_nents = sgt_append->sgt.nents;
> > > +	sgt_append->prv = s;
> > Why is nents being touched here?
> > 
> > Shouldn't it just be
> > 
> >      sgt_append->sgt.orig_nents += added_nents;
> >      sgt_append->prv = s;
> > 
> > ?
> 
> In general yes, but all the sg_alloc_* functions update both
> orig_nents and nents (to same value). May be drivers that pass nents
> instead of orig_nents to dma_map_sg* (like umem did before this
> patch set). So I prefer to set it here as well, also not to break
> sg_alloc_table_from_pages_segment which use the same path. This kind
> of change could be done very carefully next cycle for all
> sg_alloc_*.

Ok, interesting

Jason

  reply	other threads:[~2021-08-25 13:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-24 14:25 [PATCH rdma-next v4 0/3] SG fix together with update to RDMA umem Maor Gottlieb
2021-08-24 14:25 ` [Intel-gfx] " Maor Gottlieb
2021-08-24 14:25 ` [PATCH rdma-next v4 1/3] lib/scatterlist: Provide a dedicated function to support table append Maor Gottlieb
2021-08-24 14:25   ` [Intel-gfx] " Maor Gottlieb
2021-08-24 14:25 ` [PATCH rdma-next v4 2/3] lib/scatterlist: Fix wrong update of orig_nents Maor Gottlieb
2021-08-24 14:25   ` [Intel-gfx] " Maor Gottlieb
2021-08-24 19:12   ` Jason Gunthorpe
2021-08-24 19:12     ` [Intel-gfx] " Jason Gunthorpe
2021-08-25  4:59     ` Maor Gottlieb
2021-08-25  4:59       ` [Intel-gfx] " Maor Gottlieb
2021-08-25  4:59       ` Maor Gottlieb
2021-08-25 13:09       ` Jason Gunthorpe [this message]
2021-08-25 13:09         ` [Intel-gfx] " Jason Gunthorpe
2021-08-24 14:25 ` [PATCH rdma-next v4 3/3] RDMA: Use the sg_table directly and remove the opencoded version from umem Maor Gottlieb
2021-08-24 14:25   ` [Intel-gfx] " Maor Gottlieb
2021-08-24 19:40 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for SG fix together with update to RDMA umem (rev4) Patchwork
2021-08-30  8:21 ` [PATCH rdma-next v4 0/3] SG fix together with update to RDMA umem Leon Romanovsky
2021-08-30  8:21   ` Leon Romanovsky
2021-08-30  8:21   ` [Intel-gfx] " Leon Romanovsky
2021-08-30 13:31   ` Jason Gunthorpe
2021-08-30 13:31     ` [Intel-gfx] " Jason Gunthorpe
2021-08-30 13:42     ` Leon Romanovsky
2021-08-30 13:42       ` [Intel-gfx] " 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=20210825130923.GF1721383@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=aelior@marvell.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dennis.dalessandro@cornelisnetworks.com \
    --cc=dledford@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hch@infradead.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=leonro@nvidia.com \
    --cc=liangwenpeng@huawei.com \
    --cc=linux-graphics-maintainer@vmware.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=liweihang@huawei.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=maorg@nvidia.com \
    --cc=mike.marciniszyn@cornelisnetworks.com \
    --cc=mkalderon@marvell.com \
    --cc=mripard@kernel.org \
    --cc=mustafa.ismail@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=shiraz.saleem@intel.com \
    --cc=sroland@vmware.com \
    --cc=tzimmermann@suse.de \
    --cc=yishaih@nvidia.com \
    --cc=zackr@vmware.com \
    --cc=zyjzyj2000@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.