allow minhop to fail with errors.  Do "minhop but continue on with
defaults if there are errors" call as last resort routing

Al

-- 
Albert Chu
[EMAIL PROTECTED]
925-422-5311
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory
>From c77bf06c0514449bfb1d3eef2fd39df0e9cc6965 Mon Sep 17 00:00:00 2001
From: Albert Chu <[EMAIL PROTECTED]>
Date: Fri, 12 Sep 2008 14:22:27 -0700
Subject: [PATCH] allow minhop routing to fail on errors


Signed-off-by: Albert Chu <[EMAIL PROTECTED]>
---
 opensm/include/opensm/osm_ucast_minhop.h |   45 ++++++++++++++++++++++++++++++
 opensm/opensm/osm_ucast_dor.c            |    2 +-
 opensm/opensm/osm_ucast_mgr.c            |    6 ++--
 opensm/opensm/osm_ucast_minhop.c         |   21 ++++++++++++-
 opensm/opensm/osm_ucast_updn.c           |    1 +
 5 files changed, 69 insertions(+), 6 deletions(-)

diff --git a/opensm/include/opensm/osm_ucast_minhop.h b/opensm/include/opensm/osm_ucast_minhop.h
index 3e4464e..ca0f98b 100644
--- a/opensm/include/opensm/osm_ucast_minhop.h
+++ b/opensm/include/opensm/osm_ucast_minhop.h
@@ -79,6 +79,7 @@ int osm_ucast_minhop_build_lid_matrices(IN void *context);
 */
 int osm_ucast_minhop_and_dor_build_fwd_tables(IN osm_opensm_t * const p_osm,
 					      IN boolean_t initialization_error_on_no_path,
+					      IN boolean_t return_on_error,
 					      IN boolean_t dor);
 /*
 * PARAMETERS
@@ -89,6 +90,10 @@ int osm_ucast_minhop_and_dor_build_fwd_tables(IN osm_opensm_t * const p_osm,
 *		[in] indicates if a subnet initialization error should be set
 *		if no path for routing is found.
 *
+*	return_on_error
+*		[in] indicates if we should return on an error or
+*		continue on with defaults.
+*
 *	dor
 *		[in] indicates dor routing
 *
@@ -115,6 +120,46 @@ int osm_ucast_minhop_build_fwd_tables(IN void *context);
 *	This function configures switches' min hop tables.
 *********/
 
+/****f* OpenSM: Unicast Minhop/osm_ucast_minhop_no_failure_build_lid_matrices
+* NAME
+*	osm_ucast_minhop_no_failure_build_lid_matrices
+*
+* DESCRIPTION
+*	Build lid matrices for minhop routing.  Continue with defaults on 
+*	errors.
+*
+* SYNOPSIS
+*/
+void osm_ucast_minhop_no_failure_build_lid_matrices(IN osm_opensm_t * const p_osm);
+/*
+* PARAMETERS
+*	p_osm
+*		[in] Pointer to an osm_opensm_t object.
+*
+* NOTES
+*	This function builds lid matrices for min hop table calculation.
+*********/
+
+/****f* OpenSM: Unicast Minhop/ucast_minhop_build_fwd_tables
+* NAME
+*	osm_ucast_minhop_no_failure_build_fwd_tables
+*
+* DESCRIPTION
+*	Build forwarding tables for minhop routing.  Continue with defaults on
+*	errors.
+*
+* SYNOPSIS
+*/
+void osm_ucast_minhop_no_failure_build_fwd_tables(IN osm_opensm_t * const p_osm);
+/*
+* PARAMETERS
+*	p_osm
+*		[in] Pointer to an osm_opensm_t object.
+*
+* NOTES
+*	This function configures switches' min hop tables.
+*********/
+
 /****f* OpenSM: Unicast Minhop/osm_ucast_minhop_setup
 * NAME
 *	osm_ucast_minhop_setup
diff --git a/opensm/opensm/osm_ucast_dor.c b/opensm/opensm/osm_ucast_dor.c
index c9a1d43..79d2697 100644
--- a/opensm/opensm/osm_ucast_dor.c
+++ b/opensm/opensm/osm_ucast_dor.c
@@ -44,7 +44,7 @@
 int osm_ucast_dor_build_fwd_tables(void *context)
 {
 	osm_opensm_t *p_osm = context;
-        return osm_ucast_minhop_and_dor_build_fwd_tables(p_osm, TRUE, TRUE);
+        return osm_ucast_minhop_and_dor_build_fwd_tables(p_osm, TRUE, TRUE, 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 bf04121..b8272ee 100644
--- a/opensm/opensm/osm_ucast_mgr.c
+++ b/opensm/opensm/osm_ucast_mgr.c
@@ -287,9 +287,9 @@ osm_signal_t osm_ucast_mgr_process(IN osm_ucast_mgr_t * const p_mgr)
 		p_osm->routing_engine_used =
 		    osm_routing_engine_type(p_routing_eng->name);
 	else {
-		/* If configured routing algorithm failed, use MinHop */
-		osm_ucast_minhop_build_lid_matrices(p_osm);
-		osm_ucast_minhop_build_fwd_tables(p_osm);
+		/* If configured routing algorithm failed, use default MinHop */
+		osm_ucast_minhop_no_failure_build_lid_matrices(p_osm);
+		osm_ucast_minhop_no_failure_build_fwd_tables(p_osm);
 		p_osm->routing_engine_used = OSM_ROUTING_ENGINE_TYPE_MINHOP;
 	}
 
diff --git a/opensm/opensm/osm_ucast_minhop.c b/opensm/opensm/osm_ucast_minhop.c
index 1105830..490eabd 100644
--- a/opensm/opensm/osm_ucast_minhop.c
+++ b/opensm/opensm/osm_ucast_minhop.c
@@ -604,6 +604,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_opensm_t * const p_osm,
 					      boolean_t initialization_error_on_no_path,
+					      boolean_t return_on_error,
 					      boolean_t dor)
 {
 	struct osm_minhop_build_fwd_tables_data minhop_fwd_data;
@@ -623,10 +624,13 @@ int osm_ucast_minhop_and_dor_build_fwd_tables(osm_opensm_t * const p_osm,
 
 		if (parse_node_map(p_osm->subn.opt.guid_routing_order_file,
 				   add_guid_to_order_list, 
-				   &minhop_fwd_data))
+				   &minhop_fwd_data)) {
 			OSM_LOG(&p_osm->log, OSM_LOG_ERROR, "ERR : "
 				"cannot parse guid routing order file \'%s\'\n",
 				p_osm->subn.opt.guid_routing_order_file);
+			if (return_on_error)
+				return -1;
+		}
 	}
 
 	if (p_osm->subn.opt.port_prof_ignore_file) {
@@ -637,6 +641,8 @@ int osm_ucast_minhop_and_dor_build_fwd_tables(osm_opensm_t * const p_osm,
 			OSM_LOG(&p_osm->log, OSM_LOG_ERROR, "ERR : "
 				"cannot parse port prof ignore file \'%s\'\n",
 				p_osm->subn.opt.port_prof_ignore_file);
+			if (return_on_error)
+				return -1;
 		}
 	}
 
@@ -656,7 +662,18 @@ int osm_ucast_minhop_and_dor_build_fwd_tables(osm_opensm_t * const p_osm,
 int osm_ucast_minhop_build_fwd_tables(void *context)
 {
 	osm_opensm_t *p_osm = context;
-	return osm_ucast_minhop_and_dor_build_fwd_tables(p_osm, TRUE, FALSE);
+	return osm_ucast_minhop_and_dor_build_fwd_tables(p_osm, TRUE, TRUE, FALSE);
+}
+
+void osm_ucast_minhop_no_failure_build_lid_matrices(IN osm_opensm_t * const p_osm)
+{
+	/* currently doesn't fail, use standard function */
+	osm_ucast_minhop_build_lid_matrices(p_osm);
+}
+
+void osm_ucast_minhop_no_failure_build_fwd_tables(IN osm_opensm_t * const p_osm)
+{
+	osm_ucast_minhop_and_dor_build_fwd_tables(p_osm, TRUE, FALSE, 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 5236427..b9fe57d 100644
--- a/opensm/opensm/osm_ucast_updn.c
+++ b/opensm/opensm/osm_ucast_updn.c
@@ -678,6 +678,7 @@ static int osm_ucast_updn_build_fwd_tables(void *context)
 	   error when a path is not found. */
 	return osm_ucast_minhop_and_dor_build_fwd_tables(p_updn->p_osm,
 							 FALSE,
+							 TRUE,
 							 FALSE);
 }
 
-- 
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