All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Doug Ledford <dledford@redhat.com>,
	Christoph Hellwig <hch@infradead.org>,
	Maor Gottlieb <maorg@nvidia.com>,
	Ariel Elior <aelior@marvell.com>, Daniel Vetter <daniel@ffwll.ch>,
	David Airlie <airlied@linux.ie>,
	Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>,
	dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Michal Kalderon <mkalderon@marvell.com>,
	Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>,
	Mustafa Ismail <mustafa.ismail@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Roland Scheidegger <sroland@vmware.com>,
	Shiraz Saleem <shiraz.saleem@intel.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	VMware Graphics <linux-graphics-maintainer@vmware.com>,
	Weihang Li <liweihang@huawei.com>,
	Wenpeng Liang <liangwenpeng@huawei.com>,
	Yishai Hadas <yishaih@nvidia.com>, Zack Rusin <zackr@vmware.com>,
	Zhu Yanjun <zyjzyj2000@gmail.com>
Subject: Re: [PATCH rdma-next v3 2/3] lib/scatterlist: Fix wrong update of orig_nents
Date: Fri, 20 Aug 2021 12:57:39 -0300	[thread overview]
Message-ID: <20210820155739.GA531044@nvidia.com> (raw)
In-Reply-To: <20210820155425.GA530861@nvidia.com>

On Fri, Aug 20, 2021 at 12:54:25PM -0300, Jason Gunthorpe wrote:
> On Thu, Jul 29, 2021 at 12:39:12PM +0300, Leon Romanovsky wrote:
> 
> > +/**
> > + * __sg_free_table - Free a previously mapped sg table
> > + * @table:	The sg table header to use
> > + * @max_ents:	The maximum number of entries per single scatterlist
> > + * @total_ents:	The total number of entries in the table
> > + * @nents_first_chunk: Number of entries int the (preallocated) first
> > + *                     scatterlist chunk, 0 means no such preallocated
> > + *                     first chunk
> > + * @free_fn:	Free function
> > + *
> > + *  Description:
> > + *    Free an sg table previously allocated and setup with
> > + *    __sg_alloc_table().  The @max_ents value must be identical to
> > + *    that previously used with __sg_alloc_table().
> > + *
> > + **/
> > +void __sg_free_table(struct sg_table *table, unsigned int max_ents,
> > +		     unsigned int nents_first_chunk, sg_free_fn *free_fn)
> > +{
> > +	sg_free_table_entries(table, max_ents, nents_first_chunk, free_fn,
> > +			      table->orig_nents);
> > +}
> >  EXPORT_SYMBOL(__sg_free_table);
> 
> This is getting a bit indirect, there is only one caller of
> __sg_free_table() in sg_pool.c, so may as well just export
> sg_free_table_entries have have it use that directly.

And further since sg_free_table_entries() doesn't actually use table->
except for the SGL it should probably be called sg_free_table_sgl()

Jason

WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@nvidia.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Doug Ledford <dledford@redhat.com>,
	Christoph Hellwig <hch@infradead.org>,
	Maor Gottlieb <maorg@nvidia.com>,
	Ariel Elior <aelior@marvell.com>, Daniel Vetter <daniel@ffwll.ch>,
	David Airlie <airlied@linux.ie>,
	Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>,
	dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Michal Kalderon <mkalderon@marvell.com>,
	Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>,
	Mustafa Ismail <mustafa.ismail@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Roland Scheidegger <sroland@vmware.com>,
	Shiraz Saleem <shiraz.saleem@intel.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	VMware Graphics <linux-graphics-maintainer@vmware.com>,
	Weihang Li <liweihang@huawei.com>,
	Wenpeng Liang <liangwenpeng@huawei.com>,
	Yishai Hadas <yishaih@nvidia.com>, Zack Rusin <zackr@vmware.com>,
	Zhu Yanjun <zyjzyj2000@gmail.com>
Subject: Re: [Intel-gfx] [PATCH rdma-next v3 2/3] lib/scatterlist: Fix wrong update of orig_nents
Date: Fri, 20 Aug 2021 12:57:39 -0300	[thread overview]
Message-ID: <20210820155739.GA531044@nvidia.com> (raw)
In-Reply-To: <20210820155425.GA530861@nvidia.com>

On Fri, Aug 20, 2021 at 12:54:25PM -0300, Jason Gunthorpe wrote:
> On Thu, Jul 29, 2021 at 12:39:12PM +0300, Leon Romanovsky wrote:
> 
> > +/**
> > + * __sg_free_table - Free a previously mapped sg table
> > + * @table:	The sg table header to use
> > + * @max_ents:	The maximum number of entries per single scatterlist
> > + * @total_ents:	The total number of entries in the table
> > + * @nents_first_chunk: Number of entries int the (preallocated) first
> > + *                     scatterlist chunk, 0 means no such preallocated
> > + *                     first chunk
> > + * @free_fn:	Free function
> > + *
> > + *  Description:
> > + *    Free an sg table previously allocated and setup with
> > + *    __sg_alloc_table().  The @max_ents value must be identical to
> > + *    that previously used with __sg_alloc_table().
> > + *
> > + **/
> > +void __sg_free_table(struct sg_table *table, unsigned int max_ents,
> > +		     unsigned int nents_first_chunk, sg_free_fn *free_fn)
> > +{
> > +	sg_free_table_entries(table, max_ents, nents_first_chunk, free_fn,
> > +			      table->orig_nents);
> > +}
> >  EXPORT_SYMBOL(__sg_free_table);
> 
> This is getting a bit indirect, there is only one caller of
> __sg_free_table() in sg_pool.c, so may as well just export
> sg_free_table_entries have have it use that directly.

And further since sg_free_table_entries() doesn't actually use table->
except for the SGL it should probably be called sg_free_table_sgl()

Jason

  reply	other threads:[~2021-08-20 15:57 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29  9:39 [PATCH rdma-next v3 0/3] SG fix together with update to RDMA umem Leon Romanovsky
2021-07-29  9:39 ` [Intel-gfx] " Leon Romanovsky
2021-07-29  9:39 ` Leon Romanovsky
2021-07-29  9:39 ` [PATCH rdma-next v3 1/3] lib/scatterlist: Provide a dedicated function to support table append Leon Romanovsky
2021-07-29  9:39   ` [Intel-gfx] " Leon Romanovsky
2021-07-29  9:39   ` Leon Romanovsky
2021-07-29  9:39 ` [PATCH rdma-next v3 2/3] lib/scatterlist: Fix wrong update of orig_nents Leon Romanovsky
2021-07-29  9:39   ` [Intel-gfx] " Leon Romanovsky
2021-07-29  9:39   ` Leon Romanovsky
2021-08-20 15:54   ` Jason Gunthorpe
2021-08-20 15:54     ` [Intel-gfx] " Jason Gunthorpe
2021-08-20 15:57     ` Jason Gunthorpe [this message]
2021-08-20 15:57       ` Jason Gunthorpe
2021-08-23 11:09     ` Maor Gottlieb
2021-08-23 11:09       ` Maor Gottlieb
2021-08-23 11:09       ` [Intel-gfx] " Maor Gottlieb
2021-08-23 12:45       ` Jason Gunthorpe
2021-08-23 12:45         ` [Intel-gfx] " Jason Gunthorpe
2021-08-23 13:45         ` Maor Gottlieb
2021-08-23 13:54           ` Jason Gunthorpe
2021-08-23 13:54             ` [Intel-gfx] " Jason Gunthorpe
2021-07-29  9:39 ` [PATCH rdma-next v3 3/3] RDMA: Use the sg_table directly and remove the opencoded version from umem Leon Romanovsky
2021-07-29  9:39   ` [Intel-gfx] " Leon Romanovsky
2021-07-29  9:39   ` Leon Romanovsky
2021-07-29  9:42 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for SG fix together with update to RDMA umem (rev3) Patchwork
2021-08-20 16:18 ` [PATCH rdma-next v3 0/3] SG fix together with update to RDMA umem Jason Gunthorpe
2021-08-20 16:18   ` [Intel-gfx] " Jason Gunthorpe

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=20210820155739.GA531044@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=leon@kernel.org \
    --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.