[openib-general] [CM] [patch] add a check that paths are reversible when connecting RC QPs

Dotan Barak dotanb at dev.mellanox.co.il
Wed Nov 29 06:29:34 PST 2006


Check that the paths that are being used are reversible to prevent failures
when using non reversible paths.

Signed-off-by: Dotan Barak <dotanb at mellanox.co.il>

---

Index: last_stable/drivers/infiniband/core/cm.c
===================================================================
--- last_stable.orig/drivers/infiniband/core/cm.c	2006-11-28 19:21:17.000000000 +0200
+++ last_stable/drivers/infiniband/core/cm.c	2006-11-29 13:44:12.000000000 +0200
@@ -960,9 +960,13 @@ static int cm_validate_req_param(struct 
 	    param->private_data_len > IB_CM_REQ_PRIVATE_DATA_SIZE)
 		return -EINVAL;
 
+	if (!param->primary_path->reversible && param->qp_type == IB_QPT_RC)
+		return -EINVAL;
+
 	if (param->alternate_path &&
 	    (param->alternate_path->pkey != param->primary_path->pkey ||
-	     param->alternate_path->mtu != param->primary_path->mtu))
+	     param->alternate_path->mtu != param->primary_path->mtu ||
+	     (!param->alternate_path->reversible && param->qp_type == IB_QPT_RC)))
 		return -EINVAL;
 
 	return 0;






More information about the general mailing list