@@ -2464,6 +2464,14 @@ out:
return ret;
}
+static enum ib_qp_type cma_get_dest_qpt(struct rdma_id_private *id_priv)
+{
+ if (id_priv->id.qp_type == IB_QPT_XRC_INI)
+ return IB_QPT_XRC_TGT;
+
+ return id_priv->id.qp_type;
+}
+
static int cma_connect_ib(struct rdma_id_private *id_priv,
struct rdma_conn_param *conn_param)
{
@@ -2503,7 +2511,7 @@ static int cma_connect_ib(struct rdma_id_private *id_priv,
req.service_id = cma_get_service_id(id_priv->id.ps,
(struct sockaddr *) &route->addr.dst_addr);
req.qp_num = id_priv->qp_num;
- req.qp_type = IB_QPT_RC;
+ req.qp_type = cma_get_dest_qpt(id_priv);
req.starting_psn = id_priv->seq_num;
req.responder_resources = conn_param->responder_resources;
req.initiator_depth = conn_param->initiator_depth;
Allow users to connect XRC QPs through the rdma_cm. Because XRC QPs connect INI -> TGT QPs, we need to convert from the local qp type to the destination qp type when calling the ib_cm. Signed-off-by: Sean Hefty <sean.hefty@intel.com> --- drivers/infiniband/core/cma.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html