[openib-general] Re: [PATCH] [CM] 2/2 Fix CM redirection in SRP

Roland Dreier rolandd at cisco.com
Wed Sep 7 10:33:17 PDT 2005


By the way, the old code:

-			/*
-			 * Additional Reject Info contains
-			 * ClassPortInfo, which has the RedirectGID
-			 * field at an offset of 8 bytes.
-			 */
-			memcpy(target->path.dgid.raw,
-			       event->param.rej_rcvd.ari + 8, 16);

was hokey enough, but this stuff:

+			/* 
+			 * Additional Reject Info contains ClassPortInfo, which has
+			 * the RedirectGID field at an offset of 8 bytes,
+			 * the RedirectLID field at an offset of 28 bytes, 
+			 * the RedirectP_Key field at an offset of 30 bytes, and
+			 * the RedirectQP field at an offset of 33 bytes.
+			 */
+			target->path.dlid = *(__be16 *)(event->param.rej_rcvd.ari + 28);
+			target->path.pkey = *(__be16 *)(event->param.rej_rcvd.ari + 30);
+			cm_id->redirect_qpn = 
+				be32_to_cpu(*(u32 *)(event->param.rej_rcvd.ari + 32)) 
+				& 0x00ffffff;
+			if (target->path.dlid) {
+				/* 
+				 * If RedirectLID is non-zero, it is the DLID a 
+				 * requester shall use to access the class services.
+				 */
+				target->status = SRP_DLID_REDIRECT;
+			} else {
+				/*
+				 * If the RedirectLID value is zero, the redirect 
+				 * requires the requester to use the supplied 
+				 * RedirectGID to request further path resolution 
+				 * from subnet administration.  
+				 */
+				memcpy(target->path.dgid.raw,
+				       event->param.rej_rcvd.ari + 8, 16);

seems to be screaming that we need some generic handling of
ClassPortInfo for CM redirects.

 - R.



More information about the general mailing list