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

2021-08-24 Thread Maor Gottlieb
orig_nents should represent the number of entries with pages, but __sg_alloc_table_from_pages sets orig_nents as the number of total entries in the table. This is wrong when the API is used for dynamic allocation where not all the table entries are mapped with pages. It wasn't observed until now, s

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

2021-08-24 Thread Jason Gunthorpe
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 +

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

2021-08-25 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->nents

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

2021-08-25 Thread Jason Gunthorpe
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, > > >