[openib-general] [PATCH v2 2/2] iWARP changes to librdmacm.

Steve Wise swise at opengridcomputing.com
Tue Jun 20 13:03:12 PDT 2006


For iWARP, rdma_disconnect() moves the QP to SQD instead of ERR. The
iWARP providers map SQD to the RDMAC verbs CLOSING state.
---

 librdmacm/src/cma.c |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/librdmacm/src/cma.c b/librdmacm/src/cma.c
index e99d15c..a250f69 100644
--- a/librdmacm/src/cma.c
+++ b/librdmacm/src/cma.c
@@ -633,6 +633,17 @@ static int ucma_modify_qp_rts(struct rdm
 	return ibv_modify_qp(id->qp, &qp_attr, qp_attr_mask);
 }
 
+static int ucma_modify_qp_sqd(struct rdma_cm_id *id)
+{
+	struct ibv_qp_attr qp_attr;
+
+	if (!id->qp)
+		return 0;
+
+	qp_attr.qp_state = IBV_QPS_SQD;
+	return ibv_modify_qp(id->qp, &qp_attr, IBV_QP_STATE);
+}
+
 static int ucma_modify_qp_err(struct rdma_cm_id *id)
 {
 	struct ibv_qp_attr qp_attr;
@@ -881,7 +892,16 @@ int rdma_disconnect(struct rdma_cm_id *i
 	void *msg;
 	int ret, size;
 
-	ret = ucma_modify_qp_err(id);
+	switch (ibv_get_transport_type(id->verbs)) {
+	case IBV_TRANSPORT_IB:
+		ret = ucma_modify_qp_err(id);
+		break;
+	case IBV_TRANSPORT_IWARP:
+		ret = ucma_modify_qp_sqd(id);
+		break;
+	default:
+		ret = -EINVAL;
+	}
 	if (ret)
 		return ret;
 




More information about the general mailing list