add and use a osm_ucast_minhop_setup() call for similarity to other
routing engines.

Al

-- 
Albert Chu
[EMAIL PROTECTED]
925-422-5311
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory
>From 263a861748b1e7a099939466fcbd806122eee725 Mon Sep 17 00:00:00 2001
From: Albert Chu <[EMAIL PROTECTED]>
Date: Fri, 12 Sep 2008 14:19:16 -0700
Subject: [PATCH] add osm_ucast_minhop_setup function


Signed-off-by: Albert Chu <[EMAIL PROTECTED]>
---
 opensm/include/opensm/osm_ucast_minhop.h |   19 +++++++++++++++++++
 opensm/opensm/osm_opensm.c               |   16 ++++------------
 opensm/opensm/osm_ucast_minhop.c         |    8 ++++++++
 3 files changed, 31 insertions(+), 12 deletions(-)

diff --git a/opensm/include/opensm/osm_ucast_minhop.h b/opensm/include/opensm/osm_ucast_minhop.h
index d8029e6..1eb3086 100644
--- a/opensm/include/opensm/osm_ucast_minhop.h
+++ b/opensm/include/opensm/osm_ucast_minhop.h
@@ -36,6 +36,7 @@
 #ifndef _OSM_UCAST_MINHOP_H_
 #define _OSM_UCAST_MINHOP_H_
 
+#include <opensm/osm_opensm.h>
 #include <opensm/osm_ucast_mgr.h>
 
 #ifdef __cplusplus
@@ -86,5 +87,23 @@ int osm_ucast_minhop_build_fwd_tables(IN osm_ucast_mgr_t * const p_mgr);
 *	This function configures switches' min hop tables.
 *********/
 
+/****f* OpenSM: Unicast Minhop/osm_ucast_minhop_setup
+* NAME
+*	osm_ucast_minhop_setup
+*
+* DESCRIPTION
+*	Setup routing engine with minhop routing.
+*
+* SYNOPSIS
+*/
+int osm_ucast_minhop_setup(IN osm_opensm_t * p_osm);
+/*
+* PARAMETERS
+*	p_mgr
+*		[in] Pointer to an osm_opensm_t object.
+*
+*********/
+
+
 END_C_DECLS
 #endif				/* _OSM_UCAST_MINHOP_H_ */
diff --git a/opensm/opensm/osm_opensm.c b/opensm/opensm/osm_opensm.c
index 4724c40..8a66424 100644
--- a/opensm/opensm/osm_opensm.c
+++ b/opensm/opensm/osm_opensm.c
@@ -61,6 +61,7 @@
 #include <opensm/osm_ucast_file.h>
 #include <opensm/osm_ucast_ftree.h>
 #include <opensm/osm_ucast_lash.h>
+#include <opensm/osm_ucast_minhop.h>
 #include <opensm/osm_ucast_updn.h>
 
 struct routing_engine_module {
@@ -68,16 +69,14 @@ struct routing_engine_module {
 	int (*setup) (osm_opensm_t * p_osm);
 };
 
-static int osm_ucast_null_setup(osm_opensm_t * p_osm);
-
 const static struct routing_engine_module routing_modules[] = {
-	{"null", osm_ucast_null_setup},
-	{"minhop", osm_ucast_null_setup},
+	{"null", osm_ucast_minhop_setup},
+	{"minhop", osm_ucast_minhop_setup},
 	{"updn", osm_ucast_updn_setup},
 	{"file", osm_ucast_file_setup},
 	{"ftree", osm_ucast_ftree_setup},
 	{"lash", osm_ucast_lash_setup},
-	{"dor", osm_ucast_null_setup},
+	{"dor", osm_ucast_minhop_setup},
 	{NULL, NULL}
 };
 
@@ -156,13 +155,6 @@ static int setup_routing_engine(osm_opensm_t * p_osm, const char *name)
 	return -1;
 }
 
-static int osm_ucast_null_setup(osm_opensm_t * p_osm)
-{
-	OSM_LOG(&p_osm->log, OSM_LOG_VERBOSE,
-		"nothing yet - using default (minhop) routing engine\n");
-	return 0;
-}
-
 /**********************************************************************
  **********************************************************************/
 void osm_opensm_construct(IN osm_opensm_t * const p_osm)
diff --git a/opensm/opensm/osm_ucast_minhop.c b/opensm/opensm/osm_ucast_minhop.c
index 4d77dcc..fb57590 100644
--- a/opensm/opensm/osm_ucast_minhop.c
+++ b/opensm/opensm/osm_ucast_minhop.c
@@ -603,3 +603,11 @@ int osm_ucast_minhop_build_fwd_tables(osm_ucast_mgr_t * const p_mgr)
 
 	return 0;
 }
+
+int osm_ucast_minhop_setup(osm_opensm_t * p_osm)
+{
+	p_osm->routing_engine.context = (void *)p_osm;
+	p_osm->routing_engine.build_lid_matrices = NULL;
+	p_osm->routing_engine.ucast_build_fwd_tables = NULL;
+	return 0;
+}
-- 
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