make all minhop code take osm_opensm_t as a parameter instead of
osm_ucast_mgr_t for consistency to other routing engines.

Al

-- 
Albert Chu
[EMAIL PROTECTED]
925-422-5311
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory
>From 90b31014912d5fbd45d648af30ed4a3d511246ad Mon Sep 17 00:00:00 2001
From: Albert Chu <[EMAIL PROTECTED]>
Date: Fri, 12 Sep 2008 14:19:17 -0700
Subject: [PATCH] rearchitect all minhop to take osm_opensm_t as parameter


Signed-off-by: Albert Chu <[EMAIL PROTECTED]>
---
 opensm/include/opensm/osm_ucast_minhop.h |   20 ++--
 opensm/opensm/osm_ucast_dor.c            |    2 +-
 opensm/opensm/osm_ucast_mgr.c            |    4 +-
 opensm/opensm/osm_ucast_minhop.c         |  160 +++++++++++++++---------------
 opensm/opensm/osm_ucast_updn.c           |    4 +-
 5 files changed, 96 insertions(+), 94 deletions(-)

diff --git a/opensm/include/opensm/osm_ucast_minhop.h b/opensm/include/opensm/osm_ucast_minhop.h
index 3c0d8a5..9ef5480 100644
--- a/opensm/include/opensm/osm_ucast_minhop.h
+++ b/opensm/include/opensm/osm_ucast_minhop.h
@@ -58,11 +58,11 @@ BEGIN_C_DECLS
 *
 * SYNOPSIS
 */
-int osm_ucast_minhop_build_lid_matrices(IN osm_ucast_mgr_t * const p_mgr);
+int osm_ucast_minhop_build_lid_matrices(IN osm_opensm_t * const p_osm);
 /*
 * PARAMETERS
-*	p_mgr
-*		[in] Pointer to an osm_ucast_mgr_t object.
+*	p_osm
+*		[in] Pointer to an osm_opensm_t object.
 *
 * NOTES
 *	This function builds lid matrices for min hop table calculation.
@@ -77,12 +77,12 @@ int osm_ucast_minhop_build_lid_matrices(IN osm_ucast_mgr_t * const p_mgr);
 *
 * SYNOPSIS
 */
-int osm_ucast_minhop_and_dor_build_fwd_tables(IN osm_ucast_mgr_t * const p_mgr,
+int osm_ucast_minhop_and_dor_build_fwd_tables(IN osm_opensm_t * const p_osm,
 					      IN boolean_t dor);
 /*
 * PARAMETERS
-*	p_mgr
-*		[in] Pointer to an osm_ucast_mgr_t object.
+*	p_osm
+*		[in] Pointer to an osm_opensm_t object.
 *
 *	dor
 *		[in] indicates dor routing
@@ -100,11 +100,11 @@ int osm_ucast_minhop_and_dor_build_fwd_tables(IN osm_ucast_mgr_t * const p_mgr,
 *
 * SYNOPSIS
 */
-int osm_ucast_minhop_build_fwd_tables(IN osm_ucast_mgr_t * const p_mgr);
+int osm_ucast_minhop_build_fwd_tables(IN osm_opensm_t * const p_osm);
 /*
 * PARAMETERS
-*	p_mgr
-*		[in] Pointer to an osm_ucast_mgr_t object.
+*	p_osm
+*		[in] Pointer to an osm_opensm_t object.
 *
 * NOTES
 *	This function configures switches' min hop tables.
@@ -122,7 +122,7 @@ int osm_ucast_minhop_build_fwd_tables(IN osm_ucast_mgr_t * const p_mgr);
 int osm_ucast_minhop_setup(IN osm_opensm_t * p_osm);
 /*
 * PARAMETERS
-*	p_mgr
+*	p_osm
 *		[in] Pointer to an osm_opensm_t object.
 *
 *********/
diff --git a/opensm/opensm/osm_ucast_dor.c b/opensm/opensm/osm_ucast_dor.c
index df037d5..459cfef 100644
--- a/opensm/opensm/osm_ucast_dor.c
+++ b/opensm/opensm/osm_ucast_dor.c
@@ -43,7 +43,7 @@
 
 int osm_ucast_dor_build_fwd_tables(osm_opensm_t * const p_osm)
 {
-        return osm_ucast_minhop_and_dor_build_fwd_tables(&p_osm->subn.ucast_mgr, TRUE);
+        return osm_ucast_minhop_and_dor_build_fwd_tables(p_osm, TRUE);
 }
 
 int osm_ucast_dor_setup(osm_opensm_t * p_osm)
diff --git a/opensm/opensm/osm_ucast_mgr.c b/opensm/opensm/osm_ucast_mgr.c
index 7e636ff..d0259fb 100644
--- a/opensm/opensm/osm_ucast_mgr.c
+++ b/opensm/opensm/osm_ucast_mgr.c
@@ -273,7 +273,7 @@ osm_signal_t osm_ucast_mgr_process(IN osm_ucast_mgr_t * const p_mgr)
 
 	if (!p_routing_eng->build_lid_matrices ||
 	    (blm = p_routing_eng->build_lid_matrices(p_routing_eng->context)))
-		osm_ucast_minhop_build_lid_matrices(p_mgr);
+		osm_ucast_minhop_build_lid_matrices(p_osm);
 
 	/*
 	   Now that the lid matrices have been built, we can
@@ -282,7 +282,7 @@ osm_signal_t osm_ucast_mgr_process(IN osm_ucast_mgr_t * const p_mgr)
 	if (!p_routing_eng->ucast_build_fwd_tables ||
 	    (ubft =
 	     p_routing_eng->ucast_build_fwd_tables(p_routing_eng->context)))
-		osm_ucast_minhop_build_fwd_tables(p_mgr);
+		osm_ucast_minhop_build_fwd_tables(p_osm);
 
 	/* 'file' routing engine has one unique logic corner case */
 	if (p_routing_eng->name && (strcmp(p_routing_eng->name, "file") == 0)
diff --git a/opensm/opensm/osm_ucast_minhop.c b/opensm/opensm/osm_ucast_minhop.c
index 0122f98..54db855 100644
--- a/opensm/opensm/osm_ucast_minhop.c
+++ b/opensm/opensm/osm_ucast_minhop.c
@@ -55,7 +55,7 @@
 #include <opensm/osm_opensm.h>
 
 struct osm_minhop_build_lid_matrices_data {
-	osm_ucast_mgr_t *p_mgr;
+	osm_opensm_t *p_osm;
 	/* some_hop_count_set
 	 * Initialized to FALSE at the beginning of each the min hop
 	 * tables calculation iteration cycle, set to TRUE to indicate
@@ -65,7 +65,7 @@ struct osm_minhop_build_lid_matrices_data {
 };
 
 struct osm_minhop_build_fwd_tables_data {
-	osm_ucast_mgr_t *p_mgr;
+	osm_opensm_t *p_osm;
 	cl_qlist_t port_order_list;
 	boolean_t dor;
 };
@@ -104,7 +104,7 @@ __osm_ucast_minhop_process_hop_0_1(IN cl_map_item_t * const p_map_item,
 /**********************************************************************
  **********************************************************************/
 static void
-__osm_ucast_minhop_process_neighbor(IN osm_ucast_mgr_t * const p_mgr,
+__osm_ucast_minhop_process_neighbor(IN osm_opensm_t * const p_osm,
 				    IN osm_switch_t * const p_this_sw,
 				    IN osm_switch_t * const p_remote_sw,
 				    IN const uint8_t port_num,
@@ -115,18 +115,18 @@ __osm_ucast_minhop_process_neighbor(IN osm_ucast_mgr_t * const p_mgr,
 	uint16_t lid_ho;
 	uint8_t hops;
 
-	OSM_LOG_ENTER(p_mgr->p_log);
+	OSM_LOG_ENTER(&p_osm->log);
 
-	OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,
+	OSM_LOG(&p_osm->log, OSM_LOG_DEBUG,
 		"Node 0x%" PRIx64 ", remote node 0x%" PRIx64
 		", port 0x%X, remote port 0x%X\n",
 		cl_ntoh64(osm_node_get_node_guid(p_this_sw->p_node)),
 		cl_ntoh64(osm_node_get_node_guid(p_remote_sw->p_node)),
 		port_num, remote_port_num);
 
-	p_next_sw = (osm_switch_t *) cl_qmap_head(&p_mgr->p_subn->sw_guid_tbl);
+	p_next_sw = (osm_switch_t *) cl_qmap_head(&p_osm->subn.sw_guid_tbl);
 	while (p_next_sw !=
-	       (osm_switch_t *) cl_qmap_end(&p_mgr->p_subn->sw_guid_tbl)) {
+	       (osm_switch_t *) cl_qmap_end(&p_osm->subn.sw_guid_tbl)) {
 		p_sw = p_next_sw;
 		p_next_sw = (osm_switch_t *) cl_qmap_next(&p_sw->map_item);
 		lid_ho = osm_node_get_base_lid(p_sw->p_node, 0);
@@ -139,7 +139,7 @@ __osm_ucast_minhop_process_neighbor(IN osm_ucast_mgr_t * const p_mgr,
 		    osm_switch_get_hop_count(p_this_sw, lid_ho, port_num)) {
 			if (osm_switch_set_hops
 			    (p_this_sw, lid_ho, port_num, hops) != 0)
-				OSM_LOG(p_mgr->p_log, OSM_LOG_ERROR,
+				OSM_LOG(&p_osm->log, OSM_LOG_ERROR,
 					"cannot set hops for lid %u at switch 0x%"
 					PRIx64 "\n", lid_ho,
 					cl_ntoh64(osm_node_get_node_guid
@@ -148,7 +148,7 @@ __osm_ucast_minhop_process_neighbor(IN osm_ucast_mgr_t * const p_mgr,
 		}
 	}
 
-	OSM_LOG_EXIT(p_mgr->p_log);
+	OSM_LOG_EXIT(&p_osm->log);
 }
 
 /**********************************************************************
@@ -172,7 +172,7 @@ find_and_add_remote_sys(osm_switch_t *sw, uint8_t port,
 }
 
 static void
-__osm_ucast_minhop_process_port(IN osm_ucast_mgr_t * const p_mgr,
+__osm_ucast_minhop_process_port(IN osm_opensm_t * const p_osm,
 				IN osm_switch_t * const p_sw,
 				IN osm_port_t * const p_port,
 				IN unsigned lid_offset,
@@ -187,14 +187,14 @@ __osm_ucast_minhop_process_port(IN osm_ucast_mgr_t * const p_mgr,
 	struct osm_routing_engine *p_routing_eng;
 	unsigned start_from = 1;
 
-	OSM_LOG_ENTER(p_mgr->p_log);
+	OSM_LOG_ENTER(&p_osm->log);
 
 	osm_port_get_lid_range_ho(p_port, &min_lid_ho, &max_lid_ho);
 
 	/* If the lids are zero - then there was some problem with
 	 * the initialization. Don't handle this port. */
 	if (min_lid_ho == 0 || max_lid_ho == 0) {
-		OSM_LOG(p_mgr->p_log, OSM_LOG_ERROR, "ERR 3A04: "
+		OSM_LOG(&p_osm->log, OSM_LOG_ERROR, "ERR 3A04: "
 			"Port 0x%" PRIx64 " has LID 0. An initialization "
 			"error occurred. Ignoring port\n",
 			cl_ntoh64(osm_port_get_guid(p_port)));
@@ -210,7 +210,7 @@ __osm_ucast_minhop_process_port(IN osm_ucast_mgr_t * const p_mgr,
 		/* ignore potential overflow - it is handled in osm_switch.c */
 		start_from = osm_switch_get_port_by_lid(p_sw, lid_ho - 1) + 1;
 
-	OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,
+	OSM_LOG(&p_osm->log, OSM_LOG_DEBUG,
 		"Processing port 0x%" PRIx64 " (\'%s\' port %u), LID %u [%u,%u]\n",
 		cl_ntoh64(osm_port_get_guid(p_port)),
 		p_port->p_node->print_desc, p_port->p_physp->port_num,
@@ -221,7 +221,7 @@ __osm_ucast_minhop_process_port(IN osm_ucast_mgr_t * const p_mgr,
 
 	node_guid = osm_node_get_node_guid(p_sw->p_node);
 
-	p_routing_eng = &p_mgr->p_subn->p_osm->routing_engine;
+	p_routing_eng = &p_osm->routing_engine;
 
 	/*
 	   The lid matrix contains the number of hops to each
@@ -230,7 +230,7 @@ __osm_ucast_minhop_process_port(IN osm_ucast_mgr_t * const p_mgr,
 	   that can reach those LIDs.
 	 */
 	port = osm_switch_recommend_path(p_sw, p_port, lid_ho, start_from,
-					 p_mgr->p_subn->ignore_existing_lfts,
+					 p_osm->subn.ignore_existing_lfts,
 					 dor);
 
 	if (port == OSM_NO_PATH) {
@@ -240,19 +240,19 @@ __osm_ucast_minhop_process_port(IN osm_ucast_mgr_t * const p_mgr,
 		/* Up/Down routing can cause unreachable routes between some
 		   switches so we do not report that as an error in that case */
 		if (!p_routing_eng->build_lid_matrices) {
-			OSM_LOG(p_mgr->p_log, OSM_LOG_ERROR, "ERR 3A08: "
+			OSM_LOG(&p_osm->log, OSM_LOG_ERROR, "ERR 3A08: "
 				"No path to get to LID %u from switch 0x%"
 				PRIx64 "\n", lid_ho, cl_ntoh64(node_guid));
 			/* trigger a new sweep - try again ... */
-			p_mgr->p_subn->subnet_initialization_error = TRUE;
+			p_osm->subn.subnet_initialization_error = TRUE;
 		} else
-			OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,
+			OSM_LOG(&p_osm->log, OSM_LOG_DEBUG,
 				"No path to get to LID %u from switch 0x%"
 				PRIx64 "\n", lid_ho, cl_ntoh64(node_guid));
 	} else {
 		osm_physp_t *p = osm_node_get_physp_ptr(p_sw->p_node, port);
 
-		OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,
+		OSM_LOG(&p_osm->log, OSM_LOG_DEBUG,
 			"Routing LID %u to port 0x%X"
 			" for switch 0x%" PRIx64 "\n",
 			lid_ho, port, cl_ntoh64(node_guid));
@@ -267,7 +267,7 @@ __osm_ucast_minhop_process_port(IN osm_ucast_mgr_t * const p_mgr,
 		   We also would ignore this route if the target lid is of
 		   a switch and the port_profile_switch_node is not TRUE
 		 */
-		if (!p_mgr->p_subn->opt.port_profile_switch_nodes)
+		if (!p_osm->subn.opt.port_profile_switch_nodes)
 			is_ignored_by_port_prof |=
 			    (osm_node_get_type(p_port->p_node) ==
 			     IB_NODE_TYPE_SWITCH);
@@ -277,7 +277,7 @@ __osm_ucast_minhop_process_port(IN osm_ucast_mgr_t * const p_mgr,
 	   We have selected the port for this LID.
 	   Write it to the forwarding tables.
 	 */
-	p_mgr->lft_buf[lid_ho] = port;
+	p_osm->sm.ucast_mgr.lft_buf[lid_ho] = port;
 	if (!is_ignored_by_port_prof) {
 		struct osm_remote_node *rem_node_used;
 		osm_switch_count_path(p_sw, port);
@@ -288,14 +288,14 @@ __osm_ucast_minhop_process_port(IN osm_ucast_mgr_t * const p_mgr,
 	}
 
 Exit:
-	OSM_LOG_EXIT(p_mgr->p_log);
+	OSM_LOG_EXIT(&p_osm->log);
 }
 
 /**********************************************************************
  **********************************************************************/
-static void alloc_ports_priv(osm_ucast_mgr_t *mgr)
+static void alloc_ports_priv(osm_opensm_t *p_osm)
 {
-	cl_qmap_t *port_tbl = &mgr->p_subn->port_guid_tbl;
+	cl_qmap_t *port_tbl = &p_osm->subn.port_guid_tbl;
 	struct osm_remote_guids_count *r;
 	osm_port_t *port;
 	cl_map_item_t *item;
@@ -309,7 +309,7 @@ static void alloc_ports_priv(osm_ucast_mgr_t *mgr)
 			continue;
 		r = malloc(sizeof(*r) + sizeof(r->guids[0]) * (1 << lmc));
 		if (!r) {
-			OSM_LOG(mgr->p_log, OSM_LOG_ERROR, "ERR 3A09: "
+			OSM_LOG(&p_osm->log, OSM_LOG_ERROR, "ERR 3A09: "
 				"cannot allocate memory to track remote"
 				" systems for lmc > 0\n");
 			port->priv = NULL;
@@ -320,9 +320,9 @@ static void alloc_ports_priv(osm_ucast_mgr_t *mgr)
 	}
 }
 
-static void free_ports_priv(osm_ucast_mgr_t *mgr)
+static void free_ports_priv(osm_opensm_t *p_osm)
 {
-	cl_qmap_t *port_tbl = &mgr->p_subn->port_guid_tbl;
+	cl_qmap_t *port_tbl = &p_osm->subn.port_guid_tbl;
 	osm_port_t *port;
 	cl_map_item_t *item;
 	for (item = cl_qmap_head(port_tbl); item != cl_qmap_end(port_tbl);
@@ -340,41 +340,43 @@ __osm_ucast_minhop_process_tbl(IN cl_map_item_t * const p_map_item,
 			       IN void *context)
 {
 	struct osm_minhop_build_fwd_tables_data *p_minhop_fwd_data;
-	osm_ucast_mgr_t *p_mgr;
+	osm_opensm_t *p_osm;
 	osm_switch_t *const p_sw = (osm_switch_t *) p_map_item;
 	unsigned i, lids_per_port;
 	boolean_t dor;
 
 	p_minhop_fwd_data = context;
-	p_mgr = p_minhop_fwd_data->p_mgr;
+	p_osm = p_minhop_fwd_data->p_osm;
 	dor = p_minhop_fwd_data->dor;	
 
-	OSM_LOG_ENTER(p_mgr->p_log);
+	OSM_LOG_ENTER(&p_osm->log);
 
 	CL_ASSERT(p_sw && p_sw->p_node);
 
-	OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,
+	OSM_LOG(&p_osm->log, OSM_LOG_DEBUG,
 		"Processing switch 0x%" PRIx64 "\n",
 		cl_ntoh64(osm_node_get_node_guid(p_sw->p_node)));
 
 	/* Initialize LIDs in buffer to invalid port number. */
-	memset(p_mgr->lft_buf, OSM_NO_PATH, IB_LID_UCAST_END_HO + 1);
+	memset(p_osm->sm.ucast_mgr.lft_buf,
+	       OSM_NO_PATH,
+	       IB_LID_UCAST_END_HO + 1);
 
-	if (p_mgr->p_subn->opt.lmc)
-		alloc_ports_priv(p_mgr);
+	if (p_osm->subn.opt.lmc)
+		alloc_ports_priv(p_osm);
 
 	/*
 	   Iterate through every port setting LID routes for each
 	   port based on base LID and LMC value.
 	 */
-	lids_per_port = 1 << p_mgr->p_subn->opt.lmc;
+	lids_per_port = 1 << p_osm->subn.opt.lmc;
 	for (i = 0; i < lids_per_port; i++) {
 		cl_qlist_t *list = &p_minhop_fwd_data->port_order_list;
 		cl_list_item_t *item;
 		for (item = cl_qlist_head(list); item != cl_qlist_end(list);
 		     item = cl_qlist_next(item)) {
 			osm_port_t *port = cl_item_obj(item, port, list_item);
-			__osm_ucast_minhop_process_port(p_mgr, 
+			__osm_ucast_minhop_process_port(p_osm, 
 							p_sw, 
 							port, 
 							i,
@@ -382,12 +384,12 @@ __osm_ucast_minhop_process_tbl(IN cl_map_item_t * const p_map_item,
 		}
 	}
 
-	osm_ucast_mgr_set_fwd_table(p_mgr, p_sw);
+	osm_ucast_mgr_set_fwd_table(&p_osm->sm.ucast_mgr, p_sw);
 
-	if (p_mgr->p_subn->opt.lmc)
-		free_ports_priv(p_mgr);
+	if (p_osm->subn.opt.lmc)
+		free_ports_priv(p_osm);
 
-	OSM_LOG_EXIT(p_mgr->p_log);
+	OSM_LOG_EXIT(&p_osm->log);
 }
 
 /**********************************************************************
@@ -398,7 +400,7 @@ __osm_ucast_minhop_process_neighbors(IN cl_map_item_t * const p_map_item,
 {
 	osm_switch_t *const p_sw = (osm_switch_t *) p_map_item;
 	struct osm_minhop_build_lid_matrices_data *p_minhop_lid_data;
-	osm_ucast_mgr_t * p_mgr;
+	osm_opensm_t * p_osm;
 	osm_node_t *p_node;
 	osm_node_t *p_remote_node;
 	uint32_t port_num;
@@ -407,16 +409,16 @@ __osm_ucast_minhop_process_neighbors(IN cl_map_item_t * const p_map_item,
 	osm_physp_t *p_physp;
 
 	p_minhop_lid_data = context;
-	p_mgr = p_minhop_lid_data->p_mgr;
+	p_osm = p_minhop_lid_data->p_osm;
 
-	OSM_LOG_ENTER(p_mgr->p_log);
+	OSM_LOG_ENTER(&p_osm->log);
 
 	p_node = p_sw->p_node;
 
 	CL_ASSERT(p_node);
 	CL_ASSERT(osm_node_get_type(p_node) == IB_NODE_TYPE_SWITCH);
 
-	OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,
+	OSM_LOG(&p_osm->log, OSM_LOG_DEBUG,
 		"Processing switch with GUID 0x%" PRIx64 "\n",
 		cl_ntoh64(osm_node_get_node_guid(p_node)));
 
@@ -438,7 +440,7 @@ __osm_ucast_minhop_process_neighbors(IN cl_map_item_t * const p_map_item,
 			if (!p_physp || !osm_link_is_healthy(p_physp))
 				continue;
 
-			__osm_ucast_minhop_process_neighbor(p_mgr, p_sw,
+			__osm_ucast_minhop_process_neighbor(p_osm, p_sw,
 							    p_remote_node->sw,
 							    (uint8_t) port_num,
 							    remote_port_num,
@@ -446,32 +448,32 @@ __osm_ucast_minhop_process_neighbors(IN cl_map_item_t * const p_map_item,
 		}
 	}
 
-	OSM_LOG_EXIT(p_mgr->p_log);
+	OSM_LOG_EXIT(&p_osm->log);
 }
 
 /**********************************************************************
  **********************************************************************/
-int osm_ucast_minhop_build_lid_matrices(IN osm_ucast_mgr_t * const p_mgr)
+int osm_ucast_minhop_build_lid_matrices(IN osm_opensm_t * const p_osm)
 {
 	uint32_t i;
 	uint32_t iteration_max;
 	cl_qmap_t *p_sw_guid_tbl;
 	struct osm_minhop_build_lid_matrices_data minhop_lid_data;
 
-	p_sw_guid_tbl = &p_mgr->p_subn->sw_guid_tbl;
+	p_sw_guid_tbl = &p_osm->subn.sw_guid_tbl;
 
-	OSM_LOG(p_mgr->p_log, OSM_LOG_VERBOSE,
+	OSM_LOG(&p_osm->log, OSM_LOG_VERBOSE,
 		"Starting switches' Min Hop Table Assignment\n");
 
 	memset(&minhop_lid_data, '\0', sizeof(struct osm_minhop_build_lid_matrices_data));
-	minhop_lid_data.p_mgr = p_mgr;
+	minhop_lid_data.p_osm = p_osm;
 
 	/*
 	   Set the switch matrices for each switch's own port 0 LID(s)
 	   then set the lid matrices for the each switch's leaf nodes.
 	 */
 	cl_qmap_apply_func(p_sw_guid_tbl,
-			   __osm_ucast_minhop_process_hop_0_1, p_mgr);
+			   __osm_ucast_minhop_process_hop_0_1, p_osm);
 
 	/*
 	   Get the switch matrices for each switch's neighbors.
@@ -515,7 +517,7 @@ int osm_ucast_minhop_build_lid_matrices(IN osm_ucast_mgr_t * const p_mgr)
 					   __osm_ucast_minhop_process_neighbors,
 					   &minhop_lid_data);
 		}
-		OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,
+		OSM_LOG(&p_osm->log, OSM_LOG_DEBUG,
 			"Min-hop propagated in %d steps\n", i);
 	}
 
@@ -528,21 +530,21 @@ int osm_ucast_minhop_build_lid_matrices(IN osm_ucast_mgr_t * const p_mgr)
 static int add_guid_to_order_list(void *ctx, uint64_t guid, char *p)
 {
 	struct osm_minhop_build_fwd_tables_data *p_minhop_fwd_data;
-	osm_ucast_mgr_t *m;
+	osm_opensm_t *p_osm;
 	osm_port_t *port;
 
 	p_minhop_fwd_data = ctx;
-	m = p_minhop_fwd_data->p_mgr;
-	port = osm_get_port_by_guid(m->p_subn, cl_hton64(guid));
+	p_osm = p_minhop_fwd_data->p_osm;
+	port = osm_get_port_by_guid(&p_osm->subn, cl_hton64(guid));
 
 	if (!port) {
-		OSM_LOG(m->p_log, OSM_LOG_DEBUG,
+		OSM_LOG(&p_osm->log, OSM_LOG_DEBUG,
 			"port guid not found: 0x%016" PRIx64 "\n", guid);
 		return 0;
 	}
 
 	if (port->flag) {
-		OSM_LOG(m->p_log, OSM_LOG_DEBUG,
+		OSM_LOG(&p_osm->log, OSM_LOG_DEBUG,
 			"port guid specified multiple times 0x%016" PRIx64 "\n",
 			guid);
 		return 0;
@@ -568,13 +570,13 @@ static void add_port_to_order_list(cl_map_item_t * const p_map_item, void *ctx)
 
 static int mark_ignored_port(void *ctx, uint64_t guid, char *p)
 {
-	osm_ucast_mgr_t *m = ctx;
-	osm_node_t *node = osm_get_node_by_guid(m->p_subn, cl_hton64(guid));
+	osm_opensm_t *p_osm = ctx;
+	osm_node_t *node = osm_get_node_by_guid(&p_osm->subn, cl_hton64(guid));
 	osm_physp_t *physp;
 	unsigned port;
 
 	if (!node || !node->sw) {
-		OSM_LOG(m->p_log, OSM_LOG_DEBUG,
+		OSM_LOG(&p_osm->log, OSM_LOG_DEBUG,
 			"switch with guid 0x%016" PRIx64 " is not found\n",
 			guid);
 		return 0;
@@ -582,7 +584,7 @@ static int mark_ignored_port(void *ctx, uint64_t guid, char *p)
 
 	if (!p || !*p || !(port = strtoul(p, NULL, 0)) ||
 	    port >= node->sw->num_ports) {
-		OSM_LOG(m->p_log, OSM_LOG_DEBUG,
+		OSM_LOG(&p_osm->log, OSM_LOG_DEBUG,
 			"bad port specified for guid 0x%016" PRIx64 "\n", guid);
 		return 0;
 	}
@@ -608,7 +610,7 @@ static void clear_prof_ignore_flag(cl_map_item_t * const p_map_item, void *ctx)
 	}
 }
 
-int osm_ucast_minhop_and_dor_build_fwd_tables(osm_ucast_mgr_t * const p_mgr,
+int osm_ucast_minhop_and_dor_build_fwd_tables(osm_opensm_t * const p_osm,
 					      boolean_t dor)
 {
 	struct osm_minhop_build_fwd_tables_data minhop_fwd_data;
@@ -617,38 +619,38 @@ int osm_ucast_minhop_and_dor_build_fwd_tables(osm_ucast_mgr_t * const p_mgr,
 	       '\0', 
 	       sizeof(struct osm_minhop_build_fwd_tables_data));
 	cl_qlist_init(&minhop_fwd_data.port_order_list);
-	minhop_fwd_data.p_mgr = p_mgr;
+	minhop_fwd_data.p_osm = p_osm;
 	minhop_fwd_data.dor = dor;
 
-	if (p_mgr->p_subn->opt.guid_routing_order_file) {
-		OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,
+	if (p_osm->subn.opt.guid_routing_order_file) {
+		OSM_LOG(&p_osm->log, OSM_LOG_DEBUG,
 			"Fetching guid routing order file \'%s\'\n",
-			p_mgr->p_subn->opt.guid_routing_order_file);
+			p_osm->subn.opt.guid_routing_order_file);
 
-		if (parse_node_map(p_mgr->p_subn->opt.guid_routing_order_file,
+		if (parse_node_map(p_osm->subn.opt.guid_routing_order_file,
 				   add_guid_to_order_list, 
 				   &minhop_fwd_data))
-			OSM_LOG(p_mgr->p_log, OSM_LOG_ERROR, "ERR : "
+			OSM_LOG(&p_osm->log, OSM_LOG_ERROR, "ERR : "
 				"cannot parse guid routing order file \'%s\'\n",
-				p_mgr->p_subn->opt.guid_routing_order_file);
+				p_osm->subn.opt.guid_routing_order_file);
 	}
 
-	if (p_mgr->p_subn->opt.port_prof_ignore_file) {
-		cl_qmap_apply_func(&p_mgr->p_subn->sw_guid_tbl,
+	if (p_osm->subn.opt.port_prof_ignore_file) {
+		cl_qmap_apply_func(&p_osm->subn.sw_guid_tbl,
 				   clear_prof_ignore_flag, NULL);
-		if (parse_node_map(p_mgr->p_subn->opt.port_prof_ignore_file,
-				   mark_ignored_port, p_mgr)) {
-			OSM_LOG(p_mgr->p_log, OSM_LOG_ERROR, "ERR : "
+		if (parse_node_map(p_osm->subn.opt.port_prof_ignore_file,
+				   mark_ignored_port, p_osm)) {
+			OSM_LOG(&p_osm->log, OSM_LOG_ERROR, "ERR : "
 				"cannot parse port prof ignore file \'%s\'\n",
-				p_mgr->p_subn->opt.port_prof_ignore_file);
+				p_osm->subn.opt.port_prof_ignore_file);
 		}
 	}
 
-	cl_qmap_apply_func(&p_mgr->p_subn->port_guid_tbl,
+	cl_qmap_apply_func(&p_osm->subn.port_guid_tbl,
 			   add_port_to_order_list,
 			   &minhop_fwd_data);
 
-	cl_qmap_apply_func(&p_mgr->p_subn->sw_guid_tbl,
+	cl_qmap_apply_func(&p_osm->subn.sw_guid_tbl,
 			   __osm_ucast_minhop_process_tbl,
 			   &minhop_fwd_data);
 
@@ -657,9 +659,9 @@ int osm_ucast_minhop_and_dor_build_fwd_tables(osm_ucast_mgr_t * const p_mgr,
 	return 0;
 }
 
-int osm_ucast_minhop_build_fwd_tables(osm_ucast_mgr_t * const p_mgr)
+int osm_ucast_minhop_build_fwd_tables(osm_opensm_t * const p_osm)
 {
-	return osm_ucast_minhop_and_dor_build_fwd_tables(p_mgr, FALSE);
+	return osm_ucast_minhop_and_dor_build_fwd_tables(p_osm, FALSE);
 }
 
 int osm_ucast_minhop_setup(osm_opensm_t * p_osm)
diff --git a/opensm/opensm/osm_ucast_updn.c b/opensm/opensm/osm_ucast_updn.c
index b17f5c1..49799e3 100644
--- a/opensm/opensm/osm_ucast_updn.c
+++ b/opensm/opensm/osm_ucast_updn.c
@@ -617,9 +617,9 @@ static int __osm_updn_call(void *ctx)
 				p_updn->p_osm->subn.opt.root_guid_file);
 		if (p_updn->p_osm->subn.opt.connect_roots &&
 		    p_updn->num_roots > 1)
-			osm_ucast_minhop_build_lid_matrices(&p_updn->p_osm->sm.ucast_mgr);
+			osm_ucast_minhop_build_lid_matrices(p_updn->p_osm);
 	} else {
-		osm_ucast_minhop_build_lid_matrices(&p_updn->p_osm->sm.ucast_mgr);
+		osm_ucast_minhop_build_lid_matrices(p_updn->p_osm);
 		updn_find_root_nodes_by_min_hop(p_updn);
 	}
 
-- 
1.5.4.5

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to