Commit 52cdbcc2 authored by Mike Marciniszyn's avatar Mike Marciniszyn Committed by Jason Gunthorpe

IB/rdmavt: Use more efficient allowed_ops

QP creation already records the allowed_ops.

Take advantage of that single field to replace multiple qp_type
specific tests.
Reviewed-by: default avatarMichael J. Ruhl <michael.j.ruhl@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 avatarJason Gunthorpe <jgg@mellanox.com>
parent 715ab1a8
...@@ -624,10 +624,7 @@ static void rvt_clear_mr_refs(struct rvt_qp *qp, int clr_sends) ...@@ -624,10 +624,7 @@ static void rvt_clear_mr_refs(struct rvt_qp *qp, int clr_sends)
struct rvt_swqe *wqe = rvt_get_swqe_ptr(qp, qp->s_last); struct rvt_swqe *wqe = rvt_get_swqe_ptr(qp, qp->s_last);
rvt_put_swqe(wqe); rvt_put_swqe(wqe);
if (qp->allowed_ops == IB_OPCODE_UD)
if (qp->ibqp.qp_type == IB_QPT_UD ||
qp->ibqp.qp_type == IB_QPT_SMI ||
qp->ibqp.qp_type == IB_QPT_GSI)
atomic_dec(&ibah_to_rvtah( atomic_dec(&ibah_to_rvtah(
wqe->ud_wr.ah)->refcount); wqe->ud_wr.ah)->refcount);
if (++qp->s_last >= qp->s_size) if (++qp->s_last >= qp->s_size)
...@@ -2015,8 +2012,7 @@ static int rvt_post_one_wr(struct rvt_qp *qp, ...@@ -2015,8 +2012,7 @@ static int rvt_post_one_wr(struct rvt_qp *qp,
* opportunity to adjust PSN values based on internal checks. * opportunity to adjust PSN values based on internal checks.
*/ */
log_pmtu = qp->log_pmtu; log_pmtu = qp->log_pmtu;
if (qp->ibqp.qp_type != IB_QPT_UC && if (qp->allowed_ops == IB_OPCODE_UD) {
qp->ibqp.qp_type != IB_QPT_RC) {
struct rvt_ah *ah = ibah_to_rvtah(wqe->ud_wr.ah); struct rvt_ah *ah = ibah_to_rvtah(wqe->ud_wr.ah);
log_pmtu = ah->log_pmtu; log_pmtu = ah->log_pmtu;
...@@ -2064,8 +2060,7 @@ static int rvt_post_one_wr(struct rvt_qp *qp, ...@@ -2064,8 +2060,7 @@ static int rvt_post_one_wr(struct rvt_qp *qp,
return 0; return 0;
bail_inval_free_ref: bail_inval_free_ref:
if (qp->ibqp.qp_type != IB_QPT_UC && if (qp->allowed_ops == IB_OPCODE_UD)
qp->ibqp.qp_type != IB_QPT_RC)
atomic_dec(&ibah_to_rvtah(ud_wr(wr)->ah)->refcount); atomic_dec(&ibah_to_rvtah(ud_wr(wr)->ah)->refcount);
bail_inval_free: bail_inval_free:
/* release mr holds */ /* release mr holds */
...@@ -2689,9 +2684,7 @@ void rvt_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe, ...@@ -2689,9 +2684,7 @@ void rvt_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe,
/* See post_send() */ /* See post_send() */
barrier(); barrier();
rvt_put_swqe(wqe); rvt_put_swqe(wqe);
if (qp->ibqp.qp_type == IB_QPT_UD || if (qp->allowed_ops == IB_OPCODE_UD)
qp->ibqp.qp_type == IB_QPT_SMI ||
qp->ibqp.qp_type == IB_QPT_GSI)
atomic_dec(&ibah_to_rvtah(wqe->ud_wr.ah)->refcount); atomic_dec(&ibah_to_rvtah(wqe->ud_wr.ah)->refcount);
rvt_qp_swqe_complete(qp, rvt_qp_swqe_complete(qp,
......
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