All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Mike Marciniszyn
	<mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Brian Welty <brian.welty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH 22/23] IB/hfi1,IB/qib: use rvt swqe mr deref helper
Date: Wed, 07 Dec 2016 19:34:31 -0800	[thread overview]
Message-ID: <20161208033430.21135.32339.stgit@scvm10.sc.intel.com> (raw)
In-Reply-To: <20161208032312.21135.66056.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>

From: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Convert to use new swqe put routine.

Reviewed-by: Brian Welty <brian.welty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/rc.c     |   15 ++-------------
 drivers/infiniband/hw/hfi1/ruc.c    |    7 +------
 drivers/infiniband/hw/qib/qib_rc.c  |   15 ++-------------
 drivers/infiniband/hw/qib/qib_ruc.c |    7 +------
 4 files changed, 6 insertions(+), 38 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/rc.c b/drivers/infiniband/hw/hfi1/rc.c
index 42dae2e..a297f79 100644
--- a/drivers/infiniband/hw/hfi1/rc.c
+++ b/drivers/infiniband/hw/hfi1/rc.c
@@ -1146,7 +1146,6 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct ib_header *hdr)
 {
 	struct ib_other_headers *ohdr;
 	struct rvt_swqe *wqe;
-	unsigned i;
 	u32 opcode;
 	u32 psn;
 
@@ -1194,11 +1193,7 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct ib_header *hdr)
 		qp->s_last = s_last;
 		/* see post_send() */
 		barrier();
-		for (i = 0; i < wqe->wr.num_sge; i++) {
-			struct rvt_sge *sge = &wqe->sg_list[i];
-
-			rvt_put_mr(sge->mr);
-		}
+		rvt_put_swqe(wqe);
 		rvt_qp_swqe_complete(qp, wqe, IB_WC_SUCCESS);
 	}
 	/*
@@ -1229,8 +1224,6 @@ static inline void update_last_psn(struct rvt_qp *qp, u32 psn)
 					 struct rvt_swqe *wqe,
 					 struct hfi1_ibport *ibp)
 {
-	unsigned i;
-
 	lockdep_assert_held(&qp->s_lock);
 	/*
 	 * Don't decrement refcount and don't generate a
@@ -1241,11 +1234,7 @@ static inline void update_last_psn(struct rvt_qp *qp, u32 psn)
 	    cmp_psn(qp->s_sending_psn, qp->s_sending_hpsn) > 0) {
 		u32 s_last;
 
-		for (i = 0; i < wqe->wr.num_sge; i++) {
-			struct rvt_sge *sge = &wqe->sg_list[i];
-
-			rvt_put_mr(sge->mr);
-		}
+		rvt_put_swqe(wqe);
 		s_last = qp->s_last;
 		if (++s_last >= qp->s_size)
 			s_last = 0;
diff --git a/drivers/infiniband/hw/hfi1/ruc.c b/drivers/infiniband/hw/hfi1/ruc.c
index 03c8931..717ed4b 100644
--- a/drivers/infiniband/hw/hfi1/ruc.c
+++ b/drivers/infiniband/hw/hfi1/ruc.c
@@ -942,7 +942,6 @@ void hfi1_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe,
 			enum ib_wc_status status)
 {
 	u32 old_last, last;
-	unsigned i;
 
 	if (!(ib_rvt_state_ops[qp->state] & RVT_PROCESS_OR_FLUSH_SEND))
 		return;
@@ -954,11 +953,7 @@ void hfi1_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe,
 	qp->s_last = last;
 	/* See post_send() */
 	barrier();
-	for (i = 0; i < wqe->wr.num_sge; i++) {
-		struct rvt_sge *sge = &wqe->sg_list[i];
-
-		rvt_put_mr(sge->mr);
-	}
+	rvt_put_swqe(wqe);
 	if (qp->ibqp.qp_type == IB_QPT_UD ||
 	    qp->ibqp.qp_type == IB_QPT_SMI ||
 	    qp->ibqp.qp_type == IB_QPT_GSI)
diff --git a/drivers/infiniband/hw/qib/qib_rc.c b/drivers/infiniband/hw/qib/qib_rc.c
index d549905..e23ee6c 100644
--- a/drivers/infiniband/hw/qib/qib_rc.c
+++ b/drivers/infiniband/hw/qib/qib_rc.c
@@ -941,7 +941,6 @@ void qib_rc_send_complete(struct rvt_qp *qp, struct ib_header *hdr)
 {
 	struct ib_other_headers *ohdr;
 	struct rvt_swqe *wqe;
-	unsigned i;
 	u32 opcode;
 	u32 psn;
 
@@ -987,11 +986,7 @@ void qib_rc_send_complete(struct rvt_qp *qp, struct ib_header *hdr)
 		qp->s_last = s_last;
 		/* see post_send() */
 		barrier();
-		for (i = 0; i < wqe->wr.num_sge; i++) {
-			struct rvt_sge *sge = &wqe->sg_list[i];
-
-			rvt_put_mr(sge->mr);
-		}
+		rvt_put_swqe(wqe);
 		rvt_qp_swqe_complete(qp, wqe, IB_WC_SUCCESS);
 	}
 	/*
@@ -1021,8 +1016,6 @@ static inline void update_last_psn(struct rvt_qp *qp, u32 psn)
 					 struct rvt_swqe *wqe,
 					 struct qib_ibport *ibp)
 {
-	unsigned i;
-
 	/*
 	 * Don't decrement refcount and don't generate a
 	 * completion if the SWQE is being resent until the send
@@ -1032,11 +1025,7 @@ static inline void update_last_psn(struct rvt_qp *qp, u32 psn)
 	    qib_cmp24(qp->s_sending_psn, qp->s_sending_hpsn) > 0) {
 		u32 s_last;
 
-		for (i = 0; i < wqe->wr.num_sge; i++) {
-			struct rvt_sge *sge = &wqe->sg_list[i];
-
-			rvt_put_mr(sge->mr);
-		}
+		rvt_put_swqe(wqe);
 		s_last = qp->s_last;
 		if (++s_last >= qp->s_size)
 			s_last = 0;
diff --git a/drivers/infiniband/hw/qib/qib_ruc.c b/drivers/infiniband/hw/qib/qib_ruc.c
index 87e3eb5..e54a2fe 100644
--- a/drivers/infiniband/hw/qib/qib_ruc.c
+++ b/drivers/infiniband/hw/qib/qib_ruc.c
@@ -793,7 +793,6 @@ void qib_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe,
 		       enum ib_wc_status status)
 {
 	u32 old_last, last;
-	unsigned i;
 
 	if (!(ib_rvt_state_ops[qp->state] & RVT_PROCESS_OR_FLUSH_SEND))
 		return;
@@ -805,11 +804,7 @@ void qib_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe,
 	qp->s_last = last;
 	/* See post_send() */
 	barrier();
-	for (i = 0; i < wqe->wr.num_sge; i++) {
-		struct rvt_sge *sge = &wqe->sg_list[i];
-
-		rvt_put_mr(sge->mr);
-	}
+	rvt_put_swqe(wqe);
 	if (qp->ibqp.qp_type == IB_QPT_UD ||
 	    qp->ibqp.qp_type == IB_QPT_SMI ||
 	    qp->ibqp.qp_type == IB_QPT_GSI)

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-12-08  3:34 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-08  3:32 [PATCH 00/23] IB/hfi1,qib,rdmavt: Patches for 4.10 Dennis Dalessandro
     [not found] ` <20161208032312.21135.66056.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-12-08  3:32   ` [PATCH 01/23] IB/hfi1: Read new EPROM format Dennis Dalessandro
2016-12-08  3:32   ` [PATCH 02/23] IB/hfi1: Fix dc8051 multiple qword memory reads Dennis Dalessandro
2016-12-08  3:32   ` [PATCH 03/23] IB/hfi1: Use non-atomic __test_and_clear_bit in hot path Dennis Dalessandro
2016-12-08  3:32   ` [PATCH 04/23] IB/hfi1: Export 8051 memory and LCB registers via debugfs Dennis Dalessandro
2016-12-08  3:32   ` [PATCH 05/23] IB/hfi1: Disable header suppression for short packets Dennis Dalessandro
2016-12-08  3:32   ` [PATCH 06/23] IB/rdmavt: Fix trace hierarchy Dennis Dalessandro
2016-12-08  3:32   ` [PATCH 07/23] IB/hfi1: Show statistics counters under IB stats interface Dennis Dalessandro
2016-12-08  3:33   ` [PATCH 08/23] IB/hfi1: Remove dependence on qp->s_cur_size Dennis Dalessandro
2016-12-08  3:33   ` [PATCH 09/23] IB/hfi1: Remove definition of unused hfi1_affinity struct Dennis Dalessandro
2016-12-08  3:33   ` [PATCH 10/23] IB/hfi1: Add special setting for low power AOC Dennis Dalessandro
2016-12-08  3:33   ` [PATCH 11/23] IB/rdmavt: Add trace of MR segs Dennis Dalessandro
2016-12-08  3:33   ` [PATCH 12/23] IB/hfi1: Remove usage of qp->s_cur_sge Dennis Dalessandro
2016-12-08  3:33   ` [PATCH 13/23] IB/hfi1: Remove critical section gap in sc_buffer_alloc() Dennis Dalessandro
2016-12-08  3:33   ` [PATCH 14/23] IB/hfi1: Preserve external device completed bit Dennis Dalessandro
2016-12-08  3:33   ` [PATCH 15/23] IB/hfi1: Replace qp->refcount release code with standard driver wrapper Dennis Dalessandro
2016-12-08  3:33   ` [PATCH 16/23] IB/hfi1: Use reference count wrapper for MRs Dennis Dalessandro
2016-12-08  3:34   ` [PATCH 17/23] IB/qib: Use standard refcount wrapper for QPs Dennis Dalessandro
2016-12-08  3:34   ` [PATCH 18/23] IB/rdmavt: Add a send completion helper Dennis Dalessandro
2016-12-08  3:34   ` [PATCH 19/23] IB/hfi1,IB/qib: Use new " Dennis Dalessandro
2016-12-08  3:34   ` [PATCH 20/23] IB/hfi1: Avoid credit return allocation for cpu-less NUMA nodes Dennis Dalessandro
2016-12-08  3:34   ` [PATCH 21/23] IB/rdmavt: Add swqe mr deref helper Dennis Dalessandro
2016-12-08  3:34   ` Dennis Dalessandro [this message]
2016-12-08  3:34   ` [PATCH 23/23] IB/rdmavt, IB/hfi1, IB/qib: Add inlines for mtu division Dennis Dalessandro
2016-12-12 20:18   ` [PATCH 00/23] IB/hfi1,qib,rdmavt: Patches for 4.10 Doug Ledford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161208033430.21135.32339.stgit@scvm10.sc.intel.com \
    --to=dennis.dalessandro-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=brian.welty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.