[openib-general] Incorrect endian in GUID comparison/SM master selection

Hal Rosenstock halr at voltaire.com
Thu Feb 17 07:23:46 PST 2005


Hi Brian,

On Wed, 2005-02-16 at 21:37, Brian Eng wrote: 
> Per the IBA spec, the selection of a master SM is determined by the
> GUID (lowest wins).  When OpenSM does its comparison, it does not adjust
> for the endian of the host.  For our x86 systems, this means the
> comparison is based on the byte-swapped value of the GUID.  It looks
> like the patch below is in order.  Is that correct?
> 
> -- osm_sminfo_rcv.c    3 Feb 2005 19:33:39 -0000       1.2.2.3
> +++ osm_sminfo_rcv.c    16 Feb 2005 23:13:39 -0000
> @@ -173,7 +173,8 @@ __osm_sminfo_rcv_remote_sm_is_higher (
>      if( ib_sminfo_get_priority( p_remote_sm ) ==
>          p_rcv->p_subn->opt.sm_priority )
>      {
> -      if( p_remote_sm->guid < p_rcv->p_subn->sm_port_guid )
> +      if( cl_ntoh64( p_remote_sm->guid ) <
> +          cl_ntoh64( p_rcv->p_subn->sm_port_guid ) )
>        {
>          return( TRUE );
>        }

Thanks. Applied. I also added a fix to a log message when displaying the
GUID.

-- Hal




More information about the general mailing list