]> git.karo-electronics.de Git - linux-beck.git/commitdiff
IB/rdmavt: Add swqe mr deref helper
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Thu, 8 Dec 2016 03:34:25 +0000 (19:34 -0800)
committerDoug Ledford <dledford@redhat.com>
Sun, 11 Dec 2016 20:29:42 +0000 (15:29 -0500)
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>
include/rdma/rdmavt_qp.h

index d78e99cf6c111b9ded8d87804a5797e9ec272c22..04facda681e0e092564de0f0aad9fbc9791abf7f 100644 (file)
@@ -485,6 +485,23 @@ static inline void rvt_put_qp(struct rvt_qp *qp)
                wake_up(&qp->wait);
 }
 
+/**
+ * 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