Commit cbc5b2bb authored by Roland Dreier's avatar Roland Dreier

[IB] mthca: don't disable RDMA writes if no responder resources

Responder resources are only required to handle RDMA reads and atomic
operations, not RDMA writes.  So the driver should allow RDMA writes
even if responder resources are set to 0.  This is especially
important for the UC transport -- with the old code, it was impossible
to enable RDMA writes for UC QPs.
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 47f2bce9
...@@ -730,14 +730,15 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask) ...@@ -730,14 +730,15 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
} }
if (attr_mask & IB_QP_ACCESS_FLAGS) { if (attr_mask & IB_QP_ACCESS_FLAGS) {
qp_context->params2 |=
cpu_to_be32(attr->qp_access_flags & IB_ACCESS_REMOTE_WRITE ?
MTHCA_QP_BIT_RWE : 0);
/* /*
* Only enable RDMA/atomics if we have responder * Only enable RDMA reads and atomics if we have
* resources set to a non-zero value. * responder resources set to a non-zero value.
*/ */
if (qp->resp_depth) { if (qp->resp_depth) {
qp_context->params2 |=
cpu_to_be32(attr->qp_access_flags & IB_ACCESS_REMOTE_WRITE ?
MTHCA_QP_BIT_RWE : 0);
qp_context->params2 |= qp_context->params2 |=
cpu_to_be32(attr->qp_access_flags & IB_ACCESS_REMOTE_READ ? cpu_to_be32(attr->qp_access_flags & IB_ACCESS_REMOTE_READ ?
MTHCA_QP_BIT_RRE : 0); MTHCA_QP_BIT_RRE : 0);
...@@ -759,22 +760,19 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask) ...@@ -759,22 +760,19 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
if (qp->resp_depth && !attr->max_dest_rd_atomic) { if (qp->resp_depth && !attr->max_dest_rd_atomic) {
/* /*
* Lowering our responder resources to zero. * Lowering our responder resources to zero.
* Turn off RDMA/atomics as responder. * Turn off reads RDMA and atomics as responder.
* (RWE/RRE/RAE in params2 already zero) * (RRE/RAE in params2 already zero)
*/ */
qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RWE | qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RRE |
MTHCA_QP_OPTPAR_RRE |
MTHCA_QP_OPTPAR_RAE); MTHCA_QP_OPTPAR_RAE);
} }
if (!qp->resp_depth && attr->max_dest_rd_atomic) { if (!qp->resp_depth && attr->max_dest_rd_atomic) {
/* /*
* Increasing our responder resources from * Increasing our responder resources from
* zero. Turn on RDMA/atomics as appropriate. * zero. Turn on RDMA reads and atomics as
* appropriate.
*/ */
qp_context->params2 |=
cpu_to_be32(qp->atomic_rd_en & IB_ACCESS_REMOTE_WRITE ?
MTHCA_QP_BIT_RWE : 0);
qp_context->params2 |= qp_context->params2 |=
cpu_to_be32(qp->atomic_rd_en & IB_ACCESS_REMOTE_READ ? cpu_to_be32(qp->atomic_rd_en & IB_ACCESS_REMOTE_READ ?
MTHCA_QP_BIT_RRE : 0); MTHCA_QP_BIT_RRE : 0);
...@@ -782,8 +780,7 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask) ...@@ -782,8 +780,7 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
cpu_to_be32(qp->atomic_rd_en & IB_ACCESS_REMOTE_ATOMIC ? cpu_to_be32(qp->atomic_rd_en & IB_ACCESS_REMOTE_ATOMIC ?
MTHCA_QP_BIT_RAE : 0); MTHCA_QP_BIT_RAE : 0);
qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RWE | qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RRE |
MTHCA_QP_OPTPAR_RRE |
MTHCA_QP_OPTPAR_RAE); MTHCA_QP_OPTPAR_RAE);
} }
......
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