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

Brian Eng beng at isilon.com
Wed Feb 16 18:37:26 PST 2005


Hello,

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 );
       }






More information about the general mailing list