diff options
author | Tom Tucker <tom@opengridcomputing.com> | 2008-05-28 14:17:44 -0400 |
---|---|---|
committer | Tom Tucker <tom@opengridcomputing.com> | 2008-07-02 16:01:56 -0400 |
commit | 87295b6c5c7fd7bbc0ce3e7f42d2adbbac7352b9 (patch) | |
tree | 11a273d3fd2c61bbbf102b80c0b45a0f0021d499 /net/sunrpc/xprtrdma/svc_rdma_sendto.c | |
parent | e6ab9143719ff76f0b95f0866c4d0f6c743ad2e0 (diff) |
svcrdma: Add dma map count and WARN_ON
Add a dma map count in order to verify that all DMA mapping resources
have been freed when the transport is closed.
Signed-off-by: Tom Tucker <tom@opengridcomputing.com>
Diffstat (limited to 'net/sunrpc/xprtrdma/svc_rdma_sendto.c')
-rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma_sendto.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c index bdc11a30e937..a19b22b452a3 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c | |||
@@ -163,6 +163,7 @@ static int send_write(struct svcxprt_rdma *xprt, struct svc_rqst *rqstp, | |||
163 | sge_bytes = min((size_t)bc, | 163 | sge_bytes = min((size_t)bc, |
164 | (size_t)(vec->sge[xdr_sge_no].iov_len-sge_off)); | 164 | (size_t)(vec->sge[xdr_sge_no].iov_len-sge_off)); |
165 | sge[sge_no].length = sge_bytes; | 165 | sge[sge_no].length = sge_bytes; |
166 | atomic_inc(&xprt->sc_dma_used); | ||
166 | sge[sge_no].addr = | 167 | sge[sge_no].addr = |
167 | ib_dma_map_single(xprt->sc_cm_id->device, | 168 | ib_dma_map_single(xprt->sc_cm_id->device, |
168 | (void *) | 169 | (void *) |
@@ -385,6 +386,7 @@ static int send_reply(struct svcxprt_rdma *rdma, | |||
385 | ctxt->count = 1; | 386 | ctxt->count = 1; |
386 | 387 | ||
387 | /* Prepare the SGE for the RPCRDMA Header */ | 388 | /* Prepare the SGE for the RPCRDMA Header */ |
389 | atomic_inc(&rdma->sc_dma_used); | ||
388 | ctxt->sge[0].addr = | 390 | ctxt->sge[0].addr = |
389 | ib_dma_map_page(rdma->sc_cm_id->device, | 391 | ib_dma_map_page(rdma->sc_cm_id->device, |
390 | page, 0, PAGE_SIZE, DMA_TO_DEVICE); | 392 | page, 0, PAGE_SIZE, DMA_TO_DEVICE); |
@@ -396,6 +398,7 @@ static int send_reply(struct svcxprt_rdma *rdma, | |||
396 | for (sge_no = 1; byte_count && sge_no < vec->count; sge_no++) { | 398 | for (sge_no = 1; byte_count && sge_no < vec->count; sge_no++) { |
397 | sge_bytes = min_t(size_t, vec->sge[sge_no].iov_len, byte_count); | 399 | sge_bytes = min_t(size_t, vec->sge[sge_no].iov_len, byte_count); |
398 | byte_count -= sge_bytes; | 400 | byte_count -= sge_bytes; |
401 | atomic_inc(&rdma->sc_dma_used); | ||
399 | ctxt->sge[sge_no].addr = | 402 | ctxt->sge[sge_no].addr = |
400 | ib_dma_map_single(rdma->sc_cm_id->device, | 403 | ib_dma_map_single(rdma->sc_cm_id->device, |
401 | vec->sge[sge_no].iov_base, | 404 | vec->sge[sge_no].iov_base, |