[IPoIB] Fix NDIS WHQL 2c_MediaCheck test failures.
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 28 Feb 2006 19:24:36 +0000 (19:24 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 28 Feb 2006 19:24:36 +0000 (19:24 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@225 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/ipoib/kernel/ipoib_endpoint.c
ulp/ipoib/kernel/ipoib_port.c

index b665099..3d0a43f 100644 (file)
@@ -386,20 +386,25 @@ __path_query_cb(
        av_attr.sl = ib_path_rec_sl( p_path );\r
        av_attr.dlid = p_path->dlid;\r
 \r
-       if( p_path->dgid.unicast.prefix != IB_DEFAULT_SUBNET_PREFIX )\r
-       {\r
-               flow_lbl = ib_path_rec_flow_lbl( p_path );\r
-               /* Not on the same subnet, need GRH. */\r
-               av_attr.grh_valid = TRUE;\r
-               av_attr.grh.ver_class_flow = ib_grh_set_ver_class_flow(\r
-                       6, p_path->tclass, flow_lbl );\r
-               av_attr.grh.resv1 = 0;\r
-               av_attr.grh.resv2 = 0;\r
-               av_attr.grh.hop_limit = ib_path_rec_hop_limit( p_path );\r
-               av_attr.grh.src_gid = p_path->sgid;\r
-               av_attr.grh.dest_gid = p_path->dgid;\r
-       }\r
-       else if( !p_endpt->dlid )\r
+       /*\r
+        * We always send the GRH so that we preferably lookup endpoints\r
+        * by GID rather than by LID.  This allows certain WHQL tests\r
+        * such as the 2c_MediaCheck test to succeed since they don't use\r
+        * IP.  This allows endpoints to be created on the fly for requests\r
+        * for which there is no match, something that doesn't work when\r
+        * using LIDs only.\r
+        */\r
+       flow_lbl = ib_path_rec_flow_lbl( p_path );\r
+       av_attr.grh_valid = TRUE;\r
+       av_attr.grh.ver_class_flow = ib_grh_set_ver_class_flow(\r
+               6, p_path->tclass, flow_lbl );\r
+       av_attr.grh.resv1 = 0;\r
+       av_attr.grh.resv2 = 0;\r
+       av_attr.grh.hop_limit = ib_path_rec_hop_limit( p_path );\r
+       av_attr.grh.src_gid = p_path->sgid;\r
+       av_attr.grh.dest_gid = p_path->dgid;\r
+       \r
+       if( !p_endpt->dlid )\r
        {\r
                /* This is a subnet local endpoint that does not have its LID set. */\r
                p_endpt->dlid = p_path->dlid;\r
index 11743a9..5a9955a 100644 (file)
@@ -1700,16 +1700,30 @@ __recv_get_endpts(
                CL_ASSERT( *pp_dst );\r
        }\r
 \r
-       IPOIB_TRACE( (IPOIB_DBG_RECV | IPOIB_DBG_INFO),\r
-               ("Recv:\n"\r
-               "\tsrc MAC: %02X-%02X-%02X-%02X-%02X-%02X\n"\r
-               "\tdst MAC: %02X-%02X-%02X-%02X-%02X-%02X\n",\r
-               (*pp_src )->mac.addr[0], (*pp_src )->mac.addr[1],\r
-               (*pp_src )->mac.addr[2], (*pp_src )->mac.addr[3],\r
-               (*pp_src )->mac.addr[4], (*pp_src )->mac.addr[5],\r
-               (*pp_dst )->mac.addr[0], (*pp_dst )->mac.addr[1],\r
-               (*pp_dst )->mac.addr[2], (*pp_dst )->mac.addr[3],\r
-               (*pp_dst )->mac.addr[4], (*pp_dst )->mac.addr[5]) );\r
+       if( *pp_src && (*pp_src)->qpn != p_wc->recv.ud.remote_qp )\r
+       {\r
+               /* Update the QPN for the endpoint. */\r
+               IPOIB_TRACE( (IPOIB_DBG_RECV | IPOIB_DBG_WARN),\r
+                       ("Updating QPN for MAC: %02X-%02X-%02X-%02X-%02X-%02X\n",\r
+                       (*pp_src )->mac.addr[0], (*pp_src )->mac.addr[1],\r
+                       (*pp_src )->mac.addr[2], (*pp_src )->mac.addr[3],\r
+                       (*pp_src )->mac.addr[4], (*pp_src )->mac.addr[5]) );\r
+               (*pp_src)->qpn = p_wc->recv.ud.remote_qp;\r
+       }\r
+\r
+       if( *pp_src && *pp_dst )\r
+       {\r
+               IPOIB_TRACE( (IPOIB_DBG_RECV | IPOIB_DBG_INFO),\r
+                       ("Recv:\n"\r
+                       "\tsrc MAC: %02X-%02X-%02X-%02X-%02X-%02X\n"\r
+                       "\tdst MAC: %02X-%02X-%02X-%02X-%02X-%02X\n",\r
+                       (*pp_src )->mac.addr[0], (*pp_src )->mac.addr[1],\r
+                       (*pp_src )->mac.addr[2], (*pp_src )->mac.addr[3],\r
+                       (*pp_src )->mac.addr[4], (*pp_src )->mac.addr[5],\r
+                       (*pp_dst )->mac.addr[0], (*pp_dst )->mac.addr[1],\r
+                       (*pp_dst )->mac.addr[2], (*pp_dst )->mac.addr[3],\r
+                       (*pp_dst )->mac.addr[4], (*pp_dst )->mac.addr[5]) );\r
+       }\r
 \r
        IPOIB_EXIT( IPOIB_DBG_RECV );\r
 }\r