diff options
author | Mike Marciniszyn <mike.marciniszyn@intel.com> | 2016-12-07 22:34:25 -0500 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-12-11 15:29:42 -0500 |
commit | f6475223b12b3a38298976506edb042e13158798 (patch) | |
tree | 178df906187037233a76f1e799ee469867310d4d | |
parent | 9d8145a604937780898c0e4bdb124a57988fc2ed (diff) |
IB/rdmavt: Add swqe mr deref helper
Add a helper to release mr references held by
an swqe.
Reviewed-by: Brian Welty <brian.welty@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | include/rdma/rdmavt_qp.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/rdma/rdmavt_qp.h b/include/rdma/rdmavt_qp.h index d78e99cf6c11..04facda681e0 100644 --- a/include/rdma/rdmavt_qp.h +++ b/include/rdma/rdmavt_qp.h | |||
@@ -486,6 +486,23 @@ static inline void rvt_put_qp(struct rvt_qp *qp) | |||
486 | } | 486 | } |
487 | 487 | ||
488 | /** | 488 | /** |
489 | * rvt_put_swqe - drop mr refs held by swqe | ||
490 | * @wqe - the send wqe | ||
491 | * | ||
492 | * This drops any mr references held by the swqe | ||
493 | */ | ||
494 | static inline void rvt_put_swqe(struct rvt_swqe *wqe) | ||
495 | { | ||
496 | int i; | ||
497 | |||
498 | for (i = 0; i < wqe->wr.num_sge; i++) { | ||
499 | struct rvt_sge *sge = &wqe->sg_list[i]; | ||
500 | |||
501 | rvt_put_mr(sge->mr); | ||
502 | } | ||
503 | } | ||
504 | |||
505 | /** | ||
489 | * rvt_qp_wqe_reserve - reserve operation | 506 | * rvt_qp_wqe_reserve - reserve operation |
490 | * @qp - the rvt qp | 507 | * @qp - the rvt qp |
491 | * @wqe - the send wqe | 508 | * @wqe - the send wqe |