[openib-general] RE: [PATCH] [CM] 1/2 Fix CM redirection

Sean Hefty sean.hefty at intel.com
Fri Sep 9 11:03:03 PDT 2005


>Second attempt; sent this last night.  I apologize if it is a duplicate.
>
>Here's an updated change.  Took the suggestions and it should be cleaner.
>Not the be-all, end-all answer for redirection, of course, but it works
>for my situation.
>
>Any chance of inclusion as an interim fix?

Committed this with one minor change: named qpn to remote_cm_qpn to indicate
which QPN was being reported.  See below for patch.

- Sean


Index: include/rdma/ib_cm.h
===================================================================
--- include/rdma/ib_cm.h	(revision 3342)
+++ include/rdma/ib_cm.h	(working copy)
@@ -290,6 +290,7 @@ struct ib_cm_id {
 	enum ib_cm_lap_state	lap_state;	/* internal CM/debug use */
 	__be32			local_id;
 	__be32			remote_id;
+	u32			remote_cm_qpn;  /* 1 unless redirected */
 };
 
 /**
Index: core/cm.c
===================================================================
--- core/cm.c	(revision 3342)
+++ core/cm.c	(working copy)
@@ -173,7 +173,8 @@ static int cm_alloc_msg(struct cm_id_pri
 	if (IS_ERR(ah))
 		return PTR_ERR(ah);
 
-	m = ib_create_send_mad(mad_agent, 1, cm_id_priv->av.pkey_index,
+	m = ib_create_send_mad(mad_agent, cm_id_priv->id.remote_cm_qpn, 
+			       cm_id_priv->av.pkey_index,
 			       ah, 0, sizeof(struct ib_mad_hdr),
 			       sizeof(struct ib_mad)-sizeof(struct ib_mad_hdr),
 			       GFP_ATOMIC);
@@ -536,6 +537,7 @@ struct ib_cm_id *ib_create_cm_id(ib_cm_h
 	cm_id_priv->id.state = IB_CM_IDLE;
 	cm_id_priv->id.cm_handler = cm_handler;
 	cm_id_priv->id.context = context;
+	cm_id_priv->id.remote_cm_qpn = 1;
 	ret = cm_alloc_id(cm_id_priv);
 	if (ret)
 		goto error;






More information about the general mailing list