svcrdma: Clean-up svc_rdma_unmap_dma
There's no longer a need to compare each SGE's lkey with the PD's local_dma_lkey. Now that FRWR is gone, all DMA mappings are for pages that were registered with this key. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
463e63d701
commit
0d956e694a
|
@ -225,22 +225,13 @@ void svc_rdma_unmap_dma(struct svc_rdma_op_ctxt *ctxt)
|
||||||
{
|
{
|
||||||
struct svcxprt_rdma *xprt = ctxt->xprt;
|
struct svcxprt_rdma *xprt = ctxt->xprt;
|
||||||
struct ib_device *device = xprt->sc_cm_id->device;
|
struct ib_device *device = xprt->sc_cm_id->device;
|
||||||
u32 lkey = xprt->sc_pd->local_dma_lkey;
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < ctxt->mapped_sges; i++) {
|
for (i = 0; i < ctxt->mapped_sges; i++)
|
||||||
/*
|
ib_dma_unmap_page(device,
|
||||||
* Unmap the DMA addr in the SGE if the lkey matches
|
ctxt->sge[i].addr,
|
||||||
* the local_dma_lkey, otherwise, ignore it since it is
|
ctxt->sge[i].length,
|
||||||
* an FRMR lkey and will be unmapped later when the
|
ctxt->direction);
|
||||||
* last WR that uses it completes.
|
|
||||||
*/
|
|
||||||
if (ctxt->sge[i].lkey == lkey)
|
|
||||||
ib_dma_unmap_page(device,
|
|
||||||
ctxt->sge[i].addr,
|
|
||||||
ctxt->sge[i].length,
|
|
||||||
ctxt->direction);
|
|
||||||
}
|
|
||||||
ctxt->mapped_sges = 0;
|
ctxt->mapped_sges = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue