]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
OpenSM: Clear port number in attribute modifier for P_KeyTable when not switch
authoreitan <eitan@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 3 Nov 2005 13:12:45 +0000 (13:12 +0000)
committereitan <eitan@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 3 Nov 2005 13:12:45 +0000 (13:12 +0000)
When obtaining the P_KeyTable, clear the high 16 bits of the attribute
modifier when node is not a switch. This is supposed to be an ignore
field but not all implementations are conformant with this.

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

trunk/ulp/opensm/user/opensm/osm_port_info_rcv.c

index 9588e8d709119c82df9fa46655a360b531048df4..5ae9b7fe79ef3458486112d0b88bf32acbce0eb3 100644 (file)
@@ -405,6 +405,7 @@ void osm_pkey_get_tables(
   osm_dr_path_t path;
   uint8_t  port_num;
   uint16_t block_num, max_blocks;
+  uint32_t attr_mod_ho;
   osm_switch_t* p_switch;
 
   OSM_LOG_ENTER( p_log, osm_physp_has_pkey );
@@ -430,7 +431,7 @@ void osm_pkey_get_tables(
   else
   {
     /* This is a switch, and not a management port. The maximum blocks is defined
-       on the switch info partition enforcement cap. */
+       in the switch info partition enforcement cap. */
     p_switch = osm_get_switch_by_guid(p_subn, p_node->node_info.node_guid);
 
     if (! p_switch)
@@ -447,10 +448,14 @@ void osm_pkey_get_tables(
 
   for (block_num = 0 ; block_num < max_blocks  ; block_num++)
   {
+    if (osm_node_get_type( p_node ) != IB_NODE_TYPE_SWITCH)
+      attr_mod_ho = block_num;
+    else
+      attr_mod_ho = block_num | (port_num << 16);
     status = osm_req_get( p_req,
                           &path,
                           IB_MAD_ATTR_P_KEY_TABLE,
-                          cl_hton32(block_num | (port_num << 16) ),
+                          cl_hton32(attr_mod_ho),
                           CL_DISP_MSGID_NONE,
                           &context );