Re: [PATCH rdma-next v4 2/3] lib/scatterlist: Fix wrong update of orig_nents

2021-08-24 Thread Maor Gottlieb
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->ne

[PATCH rdma-next v4 1/3] lib/scatterlist: Provide a dedicated function to support table append

2021-08-24 Thread Maor Gottlieb
RDMA is the only in-kernel user that uses __sg_alloc_table_from_pages to append pages dynamically. In the next patch. That mode will be extended and that function will get more parameters. So separate it into a unique function to make such change more clear. Signed-off-by: Maor Gottlieb Signed

[PATCH rdma-next v4 2/3] lib/scatterlist: Fix wrong update of orig_nents

2021-08-24 Thread Maor Gottlieb
APIs set orig_nents as number of enries with pages. Fixes: 07da1223ec93 ("lib/scatterlist: Add support in dynamic allocation of SG table from pages") Signed-off-by: Maor Gottlieb Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/umem.c | 34 + include/linux/sca

[PATCH rdma-next v4 3/3] RDMA: Use the sg_table directly and remove the opencoded version from umem

2021-08-24 Thread Maor Gottlieb
This allows using the normal sg_table APIs and makes all the code cleaner. Remove sgt, nents and nmapd from ib_umem. Signed-off-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe --- drivers/infiniband/core/umem.c | 32 + drivers

[PATCH rdma-next v4 0/3] SG fix together with update to RDMA umem

2021-08-24 Thread Maor Gottlieb
From: Maor Gottlieb Changelog: v4: * Unify sg_free_table_entries with __sg_free_table v3: https://lore.kernel.org/lkml/cover.1627551226.git.leo...@nvidia.com/ * Rewrote to new API suggestion * Split for more patches v2: https://lore.kernel.org/lkml/cover.1626605893.git.leo...@nvidia.com

Re: [PATCH rdma-next v3 2/3] lib/scatterlist: Fix wrong update of orig_nents

2021-08-23 Thread Maor Gottlieb
On 8/20/2021 6:54 PM, 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 + *

Re: [PATCH rdma-next v3 2/3] lib/scatterlist: Fix wrong update of orig_nents

2021-08-23 Thread Maor Gottlieb
On 8/23/2021 3:45 PM, Jason Gunthorpe wrote: On Mon, Aug 23, 2021 at 02:09:37PM +0300, Maor Gottlieb wrote: On 8/20/2021 6:54 PM, 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

Re: [PATCH rdma-next v4 1/4] lib/scatterlist: Add support in dynamic allocation of SG table from pages

2020-10-03 Thread Maor Gottlieb
On 10/2/2020 6:02 PM, Jason Gunthorpe wrote: On Sun, Sep 27, 2020 at 09:46:44AM +0300, Leon Romanovsky wrote: +struct scatterlist *__sg_alloc_table_from_pages(struct sg_table *sgt, + struct page **pages, unsigned int n_pages, unsigned int offset, + unsigned long

Re: [PATCH rdma-next v4 4/4] RDMA/umem: Move to allocate SG table from pages

2020-10-01 Thread Maor Gottlieb
On 9/30/2020 2:45 PM, Jason Gunthorpe wrote: On Wed, Sep 30, 2020 at 12:53:21PM +0300, Leon Romanovsky wrote: On Tue, Sep 29, 2020 at 04:59:29PM -0300, Jason Gunthorpe wrote: On Sun, Sep 27, 2020 at 09:46:47AM +0300, Leon Romanovsky wrote: @@ -296,11 +223,17 @@ static struct ib_umem

Re: [PATCH rdma-next v4 4/4] RDMA/umem: Move to allocate SG table from pages

2020-10-01 Thread Maor Gottlieb
On 9/30/2020 6:14 PM, Jason Gunthorpe wrote: On Wed, Sep 30, 2020 at 06:05:15PM +0300, Maor Gottlieb wrote: This is right only for the last iteration. E.g. in the first iteration in case that there are more pages (left_pages), then we allocate SG_MAX_SINGLE_ALLOC.  We don't know how many pages

Re: [PATCH rdma-next v4 4/4] RDMA/umem: Move to allocate SG table from pages

2020-10-01 Thread Maor Gottlieb
On 9/30/2020 2:58 PM, Jason Gunthorpe wrote: On Wed, Sep 30, 2020 at 02:53:58PM +0300, Maor Gottlieb wrote: On 9/30/2020 2:45 PM, Jason Gunthorpe wrote: On Wed, Sep 30, 2020 at 12:53:21PM +0300, Leon Romanovsky wrote: On Tue, Sep 29, 2020 at 04:59:29PM -0300, Jason Gunthorpe wrote: On Sun

Re: [Intel-gfx] [PATCH rdma-next v3 1/2] lib/scatterlist: Add support in dynamic allocation of SG table from pages

2020-09-28 Thread Maor Gottlieb
On 9/25/2020 2:55 PM, Jason Gunthorpe wrote: On Fri, Sep 25, 2020 at 10:13:30AM +0300, Leon Romanovsky wrote: diff --git a/tools/testing/scatterlist/main.c b/tools/testing/scatterlist/main.c index 0a1464181226..4899359a31ac 100644 +++ b/tools/testing/scatterlist/main.c @@ -55,14 +55,13 @@ int

Re: [Intel-gfx] [PATCH rdma-next v3 1/2] lib/scatterlist: Add support in dynamic allocation of SG table from pages

2020-09-28 Thread Maor Gottlieb
On 9/25/2020 2:41 PM, Tvrtko Ursulin wrote: On 25/09/2020 08:13, Leon Romanovsky wrote: On Thu, Sep 24, 2020 at 09:21:20AM +0100, Tvrtko Ursulin wrote: On 22/09/2020 09:39, Leon Romanovsky wrote: From: Maor Gottlieb Extend __sg_alloc_table_from_pages to support dynamic allocation of SG

Re: [Intel-gfx] [PATCH rdma-next v3 1/2] lib/scatterlist: Add support in dynamic allocation of SG table from pages

2020-09-28 Thread Maor Gottlieb
On 9/25/2020 3:33 PM, Tvrtko Ursulin wrote: On 25/09/2020 13:18, Maor Gottlieb wrote: On 9/25/2020 2:55 PM, Jason Gunthorpe wrote: On Fri, Sep 25, 2020 at 10:13:30AM +0300, Leon Romanovsky wrote: diff --git a/tools/testing/scatterlist/main.c b/tools/testing/scatterlist/main.c index