[ofa-general] [PATCH] opensm: in UP/DOWN algo compare GUID values in host byte order

Sasha Khapyorsky sashak at voltaire.com
Fri Mar 7 18:27:57 PST 2008


In Up/Down direction is determined by comparing GUID values when
destination to root nodes is equal. This comparison was done in network
byte order - I found this as very confused when tried to use this
feature. Another bad things with it is that UP/DOWN algorithm in OpenSM
may work differently on big- and little- endian machines. Fixing this.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 opensm/opensm/osm_ucast_updn.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/opensm/opensm/osm_ucast_updn.c b/opensm/opensm/osm_ucast_updn.c
index c839f63..95bd946 100644
--- a/opensm/opensm/osm_ucast_updn.c
+++ b/opensm/opensm/osm_ucast_updn.c
@@ -180,7 +180,8 @@ __updn_bfs_by_node(IN osm_log_t * p_log,
 			rem_u = p_remote_sw->priv;
 			/* Decide which direction to mark it (UP/DOWN) */
 			next_dir = __updn_get_dir(u->rank, rem_u->rank,
-						  current_guid, remote_guid);
+						  cl_ntoh64(current_guid),
+						  cl_ntoh64(remote_guid));
 
 			/* Check if this is a legal step : the only illegal step is going
 			   from DOWN to UP */
-- 
1.5.4.1.122.gaa8d




More information about the general mailing list