To avoid code copying, need to make this function accessible by other
files.
Al
--
Albert Chu
[EMAIL PROTECTED]
925-422-5311
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory
>From 1f37f888f7c4cd73f77ad3663e169f88f850d8cf Mon Sep 17 00:00:00 2001
From: Albert L. Chu <[EMAIL PROTECTED]>
Date: Thu, 22 May 2008 10:15:13 -0700
Subject: [PATCH] make osm_ucast_mgr_process_tbl public
Signed-off-by: Albert L. Chu <[EMAIL PROTECTED]>
---
opensm/include/opensm/osm_ucast_mgr.h | 24 ++++++++++++++++++++++
opensm/opensm/osm_ucast_mgr.c | 36 ++++++++++++++++++++++++++------
2 files changed, 53 insertions(+), 7 deletions(-)
diff --git a/opensm/include/opensm/osm_ucast_mgr.h b/opensm/include/opensm/osm_ucast_mgr.h
index 25972c3..e33885f 100644
--- a/opensm/include/opensm/osm_ucast_mgr.h
+++ b/opensm/include/opensm/osm_ucast_mgr.h
@@ -258,6 +258,30 @@ osm_ucast_mgr_process_port(IN osm_ucast_mgr_t * const p_mgr,
*
*********/
+/****f* OpenSM: Unicast Manager/osm_ucast_mgr_process_tbl
+* NAME
+* osm_ucast_mgr_process_tbl
+*
+* DESCRIPTION
+* The osm_ucast_mgr_process_tbl function processes ports
+* and sets forwarding tables on the indicated switch.
+*
+* SYNOPSIS
+*/
+void
+osm_ucast_mgr_process_tbl(IN osm_switch_t *p_sw,
+ IN osm_ucast_mgr_t *p_mgr);
+/*
+* PARAMETERS
+* p_sw
+* [in] Pointer to an osm_switch_t object.
+*
+* p_mgr
+* [in] Pointer to an osm_ucast_mgr_t object.
+*
+*********/
+
+
/****f* OpenSM: Unicast Manager/osm_ucast_mgr_set_fwd_table
* NAME
* osm_ucast_mgr_set_fwd_table
diff --git a/opensm/opensm/osm_ucast_mgr.c b/opensm/opensm/osm_ucast_mgr.c
index edff8a1..e0b2717 100644
--- a/opensm/opensm/osm_ucast_mgr.c
+++ b/opensm/opensm/osm_ucast_mgr.c
@@ -465,12 +465,10 @@ osm_ucast_mgr_set_fwd_table(IN osm_ucast_mgr_t * const p_mgr,
/**********************************************************************
**********************************************************************/
-static void
-__osm_ucast_mgr_process_tbl(IN cl_map_item_t * const p_map_item,
- IN void *context)
+void
+osm_ucast_mgr_process_tbl(IN osm_switch_t *p_sw,
+ IN osm_ucast_mgr_t *p_mgr)
{
- osm_switch_t *const p_sw = (osm_switch_t *) p_map_item;
- osm_ucast_mgr_t *const p_mgr = (osm_ucast_mgr_t *) context;
osm_node_t *p_node;
osm_port_t *p_port;
const cl_qmap_t *p_port_tbl;
@@ -635,6 +633,31 @@ void osm_ucast_mgr_build_lid_matrices(IN osm_ucast_mgr_t * const p_mgr)
/**********************************************************************
**********************************************************************/
+
+static void
+__osm_ucast_mgr_build_fwd_tables_cb(IN cl_map_item_t * const p_map_item,
+ IN void *context)
+{
+ osm_switch_t *const p_sw = (osm_switch_t *) p_map_item;
+ osm_ucast_mgr_t *const p_mgr = (osm_ucast_mgr_t *) context;
+
+ osm_ucast_mgr_process_tbl(p_sw, p_mgr);
+}
+
+static void
+__osm_ucast_build_fwd_tables(IN osm_ucast_mgr_t * const p_mgr)
+{
+ cl_qmap_t *p_sw_guid_tbl;
+
+ p_sw_guid_tbl = &p_mgr->p_subn->sw_guid_tbl;
+
+ cl_qmap_apply_func(p_sw_guid_tbl, __osm_ucast_mgr_build_fwd_tables_cb,
+ p_mgr);
+}
+
+/**********************************************************************
+ **********************************************************************/
+
static int ucast_mgr_setup_all_switches(osm_subn_t * p_subn)
{
osm_switch_t *p_sw;
@@ -699,8 +722,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)))
- cl_qmap_apply_func(p_sw_guid_tbl, __osm_ucast_mgr_process_tbl,
- p_mgr);
+ __osm_ucast_build_fwd_tables(p_mgr);
/* 'file' routing engine has one unique logic corner case */
if (p_routing_eng->name && (strcmp(p_routing_eng->name, "file") == 0)
--
1.5.1
_______________________________________________
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