lkml.org 
[lkml]   [2021]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] RDMA/rw: switch to dma_map_sgtable()
On Fri, Oct 01, 2021 at 03:32:15PM -0600, Logan Gunthorpe wrote:
> There are a couple of subtle error path bugs related to mapping the
> sgls:
>
> - In rdma_rw_ctx_init(), dma_unmap would be called with an sg that
> could have been incremented from the original call, as well as an
> nents that was not the original number of nents called when mapped.
> - Similarly in rdma_rw_ctx_signature_init, both sg and prot_sg were
> unmapped with the incorrect number of nents.
>
> To fix this, switch to the sgtable interface for mapping which
> conveniently stores the original nents for unmapping. This will get
> cleaned up further once the dma mapping interface supports P2PDMA and
> pci_p2pdma_map_sg() can be removed. At that point the sgtable interface
> will be preferred as it offers better error reporting for P2PDMA pages.
>
> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
---
> drivers/infiniband/core/rw.c | 66 ++++++++++++++++++++++--------------
> 1 file changed, 41 insertions(+), 25 deletions(-)

Applied to for-next, thanks

Jason

\
 
 \ /
  Last update: 2021-10-05 20:22    [W:0.293 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site