From: Jason Gunthorpe Date: Mon, 30 Aug 2021 12:49:59 +0000 (-0300) Subject: Merge branch 'sg_nents' into rdma.git for-next X-Git-Tag: v5.15~317^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6a217437f9f5482a3f6f2dc5fcd27cf0f62409ac;p=platform%2Fkernel%2Flinux-starfive.git Merge branch 'sg_nents' into rdma.git for-next From Maor Gottlieb ==================== Fix the use of nents and orig_nents in the sg table append helpers. The nents should be used by the DMA layer to store the number of DMA mapped sges, the orig_nents is the number of CPU sges. Since the sg append logic doesn't always create a SGL with exactly orig_nents entries store a total_nents as well to allow the table to be properly free'd and reorganize the freeing logic to share across all the use cases. ==================== Signed-off-by: Jason Gunthorpe * 'sg_nents': RDMA: Use the sg_table directly and remove the opencoded version from umem lib/scatterlist: Fix wrong update of orig_nents lib/scatterlist: Provide a dedicated function to support table append --- 6a217437f9f5482a3f6f2dc5fcd27cf0f62409ac diff --cc drivers/infiniband/sw/rxe/rxe_mr.c index 1ee5bd8,b5fcb14..5890a82 --- a/drivers/infiniband/sw/rxe/rxe_mr.c +++ b/drivers/infiniband/sw/rxe/rxe_mr.c @@@ -116,12 -117,13 +117,12 @@@ int rxe_mr_init_user(struct rxe_pd *pd umem = ib_umem_get(pd->ibpd.device, start, length, access); if (IS_ERR(umem)) { - pr_warn("err %d from rxe_umem_get\n", - (int)PTR_ERR(umem)); + pr_warn("%s: Unable to pin memory region err = %d\n", + __func__, (int)PTR_ERR(umem)); err = PTR_ERR(umem); - goto err1; + goto err_out; } - mr->umem = umem; num_buf = ib_umem_num_pages(umem); rxe_mr_init(access, mr);