Commit c64607aa authored by Mike Marciniszyn's avatar Mike Marciniszyn Committed by Doug Ledford

IB/hfi1,IB/qib: use rvt swqe mr deref helper

Convert to use new swqe put routine.
Reviewed-by: default avatarBrian Welty <brian.welty@intel.com>
Signed-off-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent f6475223
...@@ -1146,7 +1146,6 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct ib_header *hdr) ...@@ -1146,7 +1146,6 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct ib_header *hdr)
{ {
struct ib_other_headers *ohdr; struct ib_other_headers *ohdr;
struct rvt_swqe *wqe; struct rvt_swqe *wqe;
unsigned i;
u32 opcode; u32 opcode;
u32 psn; u32 psn;
...@@ -1194,11 +1193,7 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct ib_header *hdr) ...@@ -1194,11 +1193,7 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct ib_header *hdr)
qp->s_last = s_last; qp->s_last = s_last;
/* see post_send() */ /* see post_send() */
barrier(); barrier();
for (i = 0; i < wqe->wr.num_sge; i++) { rvt_put_swqe(wqe);
struct rvt_sge *sge = &wqe->sg_list[i];
rvt_put_mr(sge->mr);
}
rvt_qp_swqe_complete(qp, wqe, IB_WC_SUCCESS); rvt_qp_swqe_complete(qp, wqe, IB_WC_SUCCESS);
} }
/* /*
...@@ -1229,8 +1224,6 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp, ...@@ -1229,8 +1224,6 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp,
struct rvt_swqe *wqe, struct rvt_swqe *wqe,
struct hfi1_ibport *ibp) struct hfi1_ibport *ibp)
{ {
unsigned i;
lockdep_assert_held(&qp->s_lock); lockdep_assert_held(&qp->s_lock);
/* /*
* Don't decrement refcount and don't generate a * Don't decrement refcount and don't generate a
...@@ -1241,11 +1234,7 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp, ...@@ -1241,11 +1234,7 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp,
cmp_psn(qp->s_sending_psn, qp->s_sending_hpsn) > 0) { cmp_psn(qp->s_sending_psn, qp->s_sending_hpsn) > 0) {
u32 s_last; u32 s_last;
for (i = 0; i < wqe->wr.num_sge; i++) { rvt_put_swqe(wqe);
struct rvt_sge *sge = &wqe->sg_list[i];
rvt_put_mr(sge->mr);
}
s_last = qp->s_last; s_last = qp->s_last;
if (++s_last >= qp->s_size) if (++s_last >= qp->s_size)
s_last = 0; s_last = 0;
......
...@@ -942,7 +942,6 @@ void hfi1_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe, ...@@ -942,7 +942,6 @@ void hfi1_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe,
enum ib_wc_status status) enum ib_wc_status status)
{ {
u32 old_last, last; u32 old_last, last;
unsigned i;
if (!(ib_rvt_state_ops[qp->state] & RVT_PROCESS_OR_FLUSH_SEND)) if (!(ib_rvt_state_ops[qp->state] & RVT_PROCESS_OR_FLUSH_SEND))
return; return;
...@@ -954,11 +953,7 @@ void hfi1_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe, ...@@ -954,11 +953,7 @@ void hfi1_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe,
qp->s_last = last; qp->s_last = last;
/* See post_send() */ /* See post_send() */
barrier(); barrier();
for (i = 0; i < wqe->wr.num_sge; i++) { rvt_put_swqe(wqe);
struct rvt_sge *sge = &wqe->sg_list[i];
rvt_put_mr(sge->mr);
}
if (qp->ibqp.qp_type == IB_QPT_UD || if (qp->ibqp.qp_type == IB_QPT_UD ||
qp->ibqp.qp_type == IB_QPT_SMI || qp->ibqp.qp_type == IB_QPT_SMI ||
qp->ibqp.qp_type == IB_QPT_GSI) qp->ibqp.qp_type == IB_QPT_GSI)
......
...@@ -941,7 +941,6 @@ void qib_rc_send_complete(struct rvt_qp *qp, struct ib_header *hdr) ...@@ -941,7 +941,6 @@ void qib_rc_send_complete(struct rvt_qp *qp, struct ib_header *hdr)
{ {
struct ib_other_headers *ohdr; struct ib_other_headers *ohdr;
struct rvt_swqe *wqe; struct rvt_swqe *wqe;
unsigned i;
u32 opcode; u32 opcode;
u32 psn; u32 psn;
...@@ -987,11 +986,7 @@ void qib_rc_send_complete(struct rvt_qp *qp, struct ib_header *hdr) ...@@ -987,11 +986,7 @@ void qib_rc_send_complete(struct rvt_qp *qp, struct ib_header *hdr)
qp->s_last = s_last; qp->s_last = s_last;
/* see post_send() */ /* see post_send() */
barrier(); barrier();
for (i = 0; i < wqe->wr.num_sge; i++) { rvt_put_swqe(wqe);
struct rvt_sge *sge = &wqe->sg_list[i];
rvt_put_mr(sge->mr);
}
rvt_qp_swqe_complete(qp, wqe, IB_WC_SUCCESS); rvt_qp_swqe_complete(qp, wqe, IB_WC_SUCCESS);
} }
/* /*
...@@ -1021,8 +1016,6 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp, ...@@ -1021,8 +1016,6 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp,
struct rvt_swqe *wqe, struct rvt_swqe *wqe,
struct qib_ibport *ibp) struct qib_ibport *ibp)
{ {
unsigned i;
/* /*
* Don't decrement refcount and don't generate a * Don't decrement refcount and don't generate a
* completion if the SWQE is being resent until the send * completion if the SWQE is being resent until the send
...@@ -1032,11 +1025,7 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp, ...@@ -1032,11 +1025,7 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp,
qib_cmp24(qp->s_sending_psn, qp->s_sending_hpsn) > 0) { qib_cmp24(qp->s_sending_psn, qp->s_sending_hpsn) > 0) {
u32 s_last; u32 s_last;
for (i = 0; i < wqe->wr.num_sge; i++) { rvt_put_swqe(wqe);
struct rvt_sge *sge = &wqe->sg_list[i];
rvt_put_mr(sge->mr);
}
s_last = qp->s_last; s_last = qp->s_last;
if (++s_last >= qp->s_size) if (++s_last >= qp->s_size)
s_last = 0; s_last = 0;
......
...@@ -793,7 +793,6 @@ void qib_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe, ...@@ -793,7 +793,6 @@ void qib_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe,
enum ib_wc_status status) enum ib_wc_status status)
{ {
u32 old_last, last; u32 old_last, last;
unsigned i;
if (!(ib_rvt_state_ops[qp->state] & RVT_PROCESS_OR_FLUSH_SEND)) if (!(ib_rvt_state_ops[qp->state] & RVT_PROCESS_OR_FLUSH_SEND))
return; return;
...@@ -805,11 +804,7 @@ void qib_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe, ...@@ -805,11 +804,7 @@ void qib_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe,
qp->s_last = last; qp->s_last = last;
/* See post_send() */ /* See post_send() */
barrier(); barrier();
for (i = 0; i < wqe->wr.num_sge; i++) { rvt_put_swqe(wqe);
struct rvt_sge *sge = &wqe->sg_list[i];
rvt_put_mr(sge->mr);
}
if (qp->ibqp.qp_type == IB_QPT_UD || if (qp->ibqp.qp_type == IB_QPT_UD ||
qp->ibqp.qp_type == IB_QPT_SMI || qp->ibqp.qp_type == IB_QPT_SMI ||
qp->ibqp.qp_type == IB_QPT_GSI) qp->ibqp.qp_type == IB_QPT_GSI)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment