aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma/rdmavt_qp.h
diff options
context:
space:
mode:
authorMike Marciniszyn <mike.marciniszyn@intel.com>2016-12-07 19:34:25 -0800
committerDoug Ledford <dledford@redhat.com>2016-12-11 15:29:42 -0500
commitf6475223b12b3a38298976506edb042e13158798 (patch)
tree178df906187037233a76f1e799ee469867310d4d /include/rdma/rdmavt_qp.h
parentIB/hfi1: Avoid credit return allocation for cpu-less NUMA nodes (diff)
downloadlinux-dev-f6475223b12b3a38298976506edb042e13158798.tar.xz
linux-dev-f6475223b12b3a38298976506edb042e13158798.zip
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>
Diffstat (limited to 'include/rdma/rdmavt_qp.h')
-rw-r--r--include/rdma/rdmavt_qp.h17
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)
}
/**
+ * rvt_put_swqe - drop mr refs held by swqe
+ * @wqe - the send wqe
+ *
+ * This drops any mr references held by the swqe
+ */
+static inline void rvt_put_swqe(struct rvt_swqe *wqe)
+{
+ int i;
+
+ for (i = 0; i < wqe->wr.num_sge; i++) {
+ struct rvt_sge *sge = &wqe->sg_list[i];
+
+ rvt_put_mr(sge->mr);
+ }
+}
+
+/**
* rvt_qp_wqe_reserve - reserve operation
* @qp - the rvt qp
* @wqe - the send wqe