[ofa-general] Re: OpenSM prints guids twice

Sasha Khapyorsky sashak at voltaire.com
Sat Oct 13 14:02:39 PDT 2007


Hi Yevgeny,

On 10:07 Mon 08 Oct     , Yevgeny Kliteynik wrote:
> 
>  I noticed the following problem a while ago - when the whole
>  duplicated guids and re-reading files mails were running,
>  but never had a chance to dig deeper.
> 
>  Anyway, sometimes OpenSM 'sees' the same HCA ports twice.

It is just how osm_state_mgr_report() is done - it iterates nodes by
port_guid_tbl map and not by node_guid_tbl. I have no idea why it was
done this way, likely just a bug. Anyway the patch below fixes this.

Sasha


commit b272c11fa910And07a0b02d5544ea75507f69515c
Author: Sasha Khapyorsky <sashak at voltaire.com>
Date:   Mon Oct 8 15:02:54 2007 +0200

    opensm: report message fix
    
    Generate OpenSM report message node by node (not by ports), and so
    eliminate duplicated nodes reporting.
    
    Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>

diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c
index e5ef89d..4646c8a 100644
--- a/opensm/opensm/osm_state_mgr.c
+++ b/opensm/opensm/osm_state_mgr.c
@@ -1169,7 +1169,6 @@ static void __osm_topology_file_create(IN osm_state_mgr_t * const p_mgr)
 static void __osm_state_mgr_report(IN osm_state_mgr_t * const p_mgr)
 {
 	const cl_qmap_t *p_tbl;
-	const osm_port_t *p_port;
 	const osm_node_t *p_node;
 	const osm_physp_t *p_physp;
 	const osm_physp_t *p_remote_physp;
@@ -1191,23 +1190,22 @@ static void __osm_state_mgr_report(IN osm_state_mgr_t * const p_mgr)
 		       ": #  : Sta : LID  : LMC : MTU  : LWA : LSA : Port GUID    "
 		       "    : Neighbor Port (Port #)\n");
 
-	p_tbl = &p_mgr->p_subn->port_guid_tbl;
+	p_tbl = &p_mgr->p_subn->node_guid_tbl;
 
 	/*
 	 * Hold lock non-exclusively while we perform these read-only operations.
 	 */
 
 	CL_PLOCK_ACQUIRE(p_mgr->p_lock);
-	p_port = (osm_port_t *) cl_qmap_head(p_tbl);
-	while (p_port != (osm_port_t *) cl_qmap_end(p_tbl)) {
+	p_node = (osm_node_t *) cl_qmap_head(p_tbl);
+	while (p_node != (osm_node_t *) cl_qmap_end(p_tbl)) {
 		if (osm_log_is_active(p_mgr->p_log, OSM_LOG_DEBUG)) {
 			osm_log(p_mgr->p_log, OSM_LOG_DEBUG,
 				"__osm_state_mgr_report: "
-				"Processing port 0x%016" PRIx64 "\n",
-				cl_ntoh64(osm_port_get_guid(p_port)));
+				"Processing node 0x%016" PRIx64 "\n",
+				cl_ntoh64(osm_node_get_node_guid(p_node)));
 		}
 
-		p_node = p_port->p_node;
 		node_type = osm_node_get_type(p_node);
 		if (node_type == IB_NODE_TYPE_SWITCH)
 			start_port = 0;
@@ -1311,7 +1309,7 @@ static void __osm_state_mgr_report(IN osm_state_mgr_t * const p_mgr)
 		osm_log_printf(p_mgr->p_log, OSM_LOG_VERBOSE,
 			       "------------------------------------------------------"
 			       "------------------------------------------------\n");
-		p_port = (osm_port_t *) cl_qmap_next(&p_port->map_item);
+		p_node = (osm_node_t *) cl_qmap_next(&p_node->map_item);
 	}
 
 	CL_PLOCK_RELEASE(p_mgr->p_lock);



More information about the general mailing list