[openib-general] [PATCH] OpenSM: Clear port number in attribute modifier for P_KeyTable when not switch
Hal Rosenstock
halr at voltaire.com
Wed Nov 2 04:43:22 PST 2005
Hi,
Any objections to committing the patch below ?
-- Hal
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.
Signed-off-by: Hal Rosenstock <halr at voltaire.com>
Index: osm_port_info_rcv.c
===================================================================
--- osm_port_info_rcv.c (revision 3906)
+++ osm_port_info_rcv.c (working copy)
@@ -430,6 +430,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 );
@@ -455,7 +456,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)
@@ -472,10 +473,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 );
More information about the general
mailing list