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

Roland Dreier rdreier at cisco.com
Mon May 22 13:09:48 PDT 2006


Thanks, I applied the version below.

> 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?

I guess it depends on when real targets would send DREQs.  In general
if a target is saying it wants to close a connection, it seems sort of
rude to try and reconnect immediately...

 - R.

Index: infiniband/ulp/srp/ib_srp.c
===================================================================
--- infiniband/ulp/srp/ib_srp.c	(revision 7398)
+++ infiniband/ulp/srp/ib_srp.c	(working copy)
@@ -1201,11 +1201,10 @@ static int srp_cm_handler(struct ib_cm_i
 		srp_cm_rej_handler(cm_id, event, target);
 		break;
 
-	case IB_CM_MRA_RECEIVED:
-		printk(KERN_ERR PFX "MRA received\n");
-		break;
-
-	case IB_CM_DREP_RECEIVED:
+	case IB_CM_DREQ_RECEIVED:
+		printk(KERN_WARNING PFX "DREQ received - connection closed\n");
+		if (ib_send_cm_drep(cm_id, NULL, 0))
+			printk(KERN_ERR PFX "Sending CM DREP failed\n");
 		break;
 
 	case IB_CM_TIMEWAIT_EXIT:
@@ -1215,6 +1214,11 @@ static int srp_cm_handler(struct ib_cm_i
 		target->status = 0;
 		break;
 
+	case IB_CM_MRA_RECEIVED:
+	case IB_CM_DREQ_ERROR:
+	case IB_CM_DREP_RECEIVED:
+		break;
+
 	default:
 		printk(KERN_WARNING PFX "Unhandled CM event %d\n", event->event);
 		break;



More information about the general mailing list