]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[OpenSM] - In osm_physp_share_pkey, no need to check pkey tables
authoreitan <eitan@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 13 Mar 2006 08:07:16 +0000 (08:07 +0000)
committereitan <eitan@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 13 Mar 2006 08:07:16 +0000 (08:07 +0000)
when the two ports are the same

git-svn-id: svn://openib.tc.cornell.edu/gen1@243 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

trunk/ulp/opensm/user/opensm/osm_pkey.c

index d9bc2b75c7abdc149e864689d0b7fefd9a427a18..f2d594b548707692791d5ba11b9168dc55b5f3d0 100644 (file)
@@ -140,7 +140,7 @@ int osm_pkey_tbl_set(
     tables there is no other way but to refresh the entire keys map.
 
     Moreover, if the same key exists but with full membership it should have
-    precedence on the key with partial membership !
+    precedence on the key with limited membership !
   */
   cl_map_remove_all( &p_pkey_tbl->keys );
 
@@ -207,13 +207,16 @@ osm_physp_share_pkey(
 
   OSM_LOG_ENTER( p_log, osm_physp_share_pkey );
 
+  /* If two ports are same, no need to check */
+  if (p_physp_1 == p_physp_2)
+    return (TRUE);
+
   pkey_tbl1 = osm_physp_get_pkey_tbl(p_physp_1);
   pkey_tbl2 = osm_physp_get_pkey_tbl(p_physp_2);
   
   /* 
      The spec: 10.9.2 does not require each phys port to have PKey Table.
-     So actually if it does not - we would need to use the default port
-     instead.
+     So actually if it does not, we need to use the default port instead.
 
      HACK: meanwhile we will ignore the check
   */
@@ -235,7 +238,6 @@ osm_physp_share_pkey(
 
     if (__osm_match_pkey(pkey1, pkey2))
     {
-
       osm_log( p_log, OSM_LOG_DEBUG,
                "osm_physp_share_pkey: "
                "Matched pkeys: 0x%04x 0x%04x\n",
@@ -244,7 +246,7 @@ osm_physp_share_pkey(
       return(TRUE);
     }
     
-    /* advance the lower value if they are no equal */
+    /* advance the lower value if they are not equal */
     pkey1_base = cl_map_key( map_iter1 );
     pkey2_base = cl_map_key( map_iter2 );
     if (pkey2_base == pkey1_base)