From bd000d6b63aaf5684ced1a8fe12f14b24bfb8f3a Mon Sep 17 00:00:00 2001 From: eitan Date: Thu, 3 Nov 2005 13:12:45 +0000 Subject: [PATCH] OpenSM: Clear port number in attribute modifier for P_KeyTable when not switch 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 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/trunk/ulp/opensm/user/opensm/osm_port_info_rcv.c b/trunk/ulp/opensm/user/opensm/osm_port_info_rcv.c index 9588e8d7..5ae9b7fe 100644 --- a/trunk/ulp/opensm/user/opensm/osm_port_info_rcv.c +++ b/trunk/ulp/opensm/user/opensm/osm_port_info_rcv.c @@ -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 ); -- 2.41.0