[ofa-general] IPoIB CM (NOSRQ) [PATCH 2]

Pradeep Satyanarayana pradeeps at linux.vnet.ibm.com
Wed Aug 15 16:32:29 PDT 2007


This patch provides a fall back mechanism to UD mode if enough resources
are not available in CM mode.

Signed-off-by: Pradeep Satyanarayana <pradeeps at linux.vnet.ibm.com>
---

--- a/linux-2.6.23-rc1/drivers/infiniband/ulp/ipoib/ipoib_cm.c	2007-08-15 18:16:26.000000000 -0400
+++ b/linux-2.6.23-rc1/drivers/infiniband/ulp/ipoib/ipoib_cm.c	2007-08-15 18:20:21.000000000 -0400
@@ -1369,8 +1369,18 @@ static int ipoib_cm_tx_handler(struct ib
 			ib_send_cm_rej(cm_id, IB_CM_REJ_CONSUMER_DEFINED,
 				       NULL, 0, NULL, 0);
 		break;
-	case IB_CM_REQ_ERROR:
 	case IB_CM_REJ_RECEIVED:
+		ipoib_warn(priv, "REJ received\n");
+		spin_lock(&priv->lock);
+		neigh = tx->neigh;
+		spin_unlock(&priv->lock);
+
+		if ((neigh) && (event->param.rej_rcvd.reason ==
+		   IB_CM_REJ_NO_QP)) {
+			clear_bit(IPOIB_FLAG_OPER_UP, &neigh->cm->flags);
+			break;
+		}
+	case IB_CM_REQ_ERROR:
 	case IB_CM_TIMEWAIT_EXIT:
 		ipoib_dbg(priv, "CM error %d.\n", event->event);
 		spin_lock_irq(&priv->tx_lock);
--- a/linux-2.6.23-rc1/drivers/infiniband/ulp/ipoib/ipoib_main.c	2007-08-15 18:16:26.000000000 -0400
+++ b/linux-2.6.23-rc1/drivers/infiniband/ulp/ipoib/ipoib_main.c	2007-08-15 18:16:44.000000000 -0400
@@ -679,11 +679,10 @@ static int ipoib_start_xmit(struct sk_bu
 
 		neigh = *to_ipoib_neigh(skb->dst->neighbour);
 
-		if (ipoib_cm_get(neigh)) {
-			if (ipoib_cm_up(neigh)) {
+		if (ipoib_cm_get(neigh) &&  ipoib_cm_up(neigh) &&
+			test_bit(IPOIB_FLAG_OPER_UP, &neigh->cm->flags)) {
 				ipoib_cm_send(dev, skb, ipoib_cm_get(neigh));
 				goto out;
-			}
 		} else if (neigh->ah) {
 			if (unlikely(memcmp(&neigh->dgid.raw,
 					    skb->dst->neighbour->ha + 4,




More information about the general mailing list