[openib-general] [PATCH] OpenSM: Clear port number in attribu te modifier for P_KeyTable when not switch

Eitan Zahavi eitan at mellanox.co.il
Wed Nov 2 05:46:49 PST 2005


It's ok.

Eitan Zahavi
Design Technology Director
Mellanox Technologies LTD
Tel:+972-4-9097208
Fax:+972-4-9593245
P.O. Box 586 Yokneam 20692 ISRAEL


> -----Original Message-----
> From: Hal Rosenstock [mailto:halr at voltaire.com]
> Sent: Wednesday, November 02, 2005 2:43 PM
> To: openib-general at openib.org
> Subject: [openib-general] [PATCH] OpenSM: Clear port number in attribute
modifier
> for P_KeyTable when not switch
> 
> 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 );
> 
> 
> 
> 
> _______________________________________________
> openib-general mailing list
> openib-general at openib.org
> http://openib.org/mailman/listinfo/openib-general
> 
> To unsubscribe, please visit
http://openib.org/mailman/listinfo/openib-general
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20051102/f6a9d997/attachment.html>


More information about the general mailing list