[openib-general] SRP: [PATCH] Handling DREQ

Ishai Rabinovitz ishai at mellanox.co.il
Thu May 18 16:54:35 PDT 2006


Hi,

I got "Unhandled CM event 6" (IB_CM_DREQ_ERROR) and "Unhandled CM event 7" 
(IB_CM_DREQ_RECEIVED).

So here is a patch that handles these CM events.

This is an initial patch. Maybe it will be more efficient to initiate a reconnect 
in case we get IB_CM_DREQ_RECEIVED.  What do you think?

Signed-off-by: Ishai Rabinovitz <ishai at mellanox.co.il>

Index: last_stable/drivers/infiniband/ulp/srp/ib_srp.c
===================================================================
--- last_stable.orig/drivers/infiniband/ulp/srp/ib_srp.c	2006-05-19 00:05:30.000000000 +0300
+++ last_stable/drivers/infiniband/ulp/srp/ib_srp.c	2006-05-19 01:35:37.000000000 +0300
@@ -1214,13 +1231,29 @@ static int srp_cm_handler(struct ib_cm_i
 		target->status = 0;
 		break;
 
+	case IB_CM_DREQ_ERROR:
+		printk(KERN_ERR PFX
+		       "IB_CM_DREQ_ERROR received - connection closed\n");
+		/* no need to set comp - there will be a TIMEWAIT_EXIT */
+		break;
+
+	case IB_CM_DREQ_RECEIVED:
+		printk(KERN_ERR PFX
+		       "IB_CM_DREQ_RECEIVED received - connection closed\n");
+		if (ib_send_cm_drep(target->cm_id, NULL, 0))
+			printk(KERN_ERR PFX "ib_send_cm_drep failed\n");
+		/* no need to set comp - there will be a TIMEWAIT_EXIT */
+		break;
+
 	default:
 		printk(KERN_WARNING PFX "Unhandled CM event %d\n", event->event);
 		break;
 	}
 
-	if (comp)
+	if (comp) {
+		printk(KERN_ERR PFX "srp_cm_handler: complete to %p\n", target);
 		complete(&target->done);
+	}
 
 	kfree(qp_attr);
 
-- 
Ishai Rabinovitz



More information about the general mailing list