From 93b770628b42b5440962496a117a00b584b1db74 Mon Sep 17 00:00:00 2001 From: eitan Date: Mon, 13 Mar 2006 08:07:16 +0000 Subject: [PATCH] [OpenSM] - In osm_physp_share_pkey, no need to check pkey tables 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 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/trunk/ulp/opensm/user/opensm/osm_pkey.c b/trunk/ulp/opensm/user/opensm/osm_pkey.c index d9bc2b75..f2d594b5 100644 --- a/trunk/ulp/opensm/user/opensm/osm_pkey.c +++ b/trunk/ulp/opensm/user/opensm/osm_pkey.c @@ -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) -- 2.41.0