[openib-general] [PATCH] opensm: switch lookups consolidation with osm_get_switch_by_guid()

Sasha Khapyorsky sashak at voltaire.com
Sun Nov 26 15:32:00 PST 2006


For switch object lookups, instead of repetead in many places code
fragments like:

  p_sw_guid_tbl = &p_mgr->p_subn->sw_guid_tbl;

  p_sw = (osm_switch_t*)cl_qmap_get( p_sw_guid_tbl, node_guid );
  if (p_sw == (osm_switch_t*)cl_qmap_end( p_sw_guid_tbl ) ) { ... }

use already existing "centralized" osm_get_switch_by_guid() function.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 osm/opensm/osm_drop_mgr.c            |    7 +----
 osm/opensm/osm_lin_fwd_rcv.c         |    6 +---
 osm/opensm/osm_mcast_fwd_rcv.c       |    6 +---
 osm/opensm/osm_mcast_mgr.c           |   39 ++++++++++++++--------------------
 osm/opensm/osm_node_info_rcv.c       |    8 +-----
 osm/opensm/osm_sa_multipath_record.c |   20 +++++++----------
 osm/opensm/osm_sa_path_record.c      |   20 +++++++----------
 osm/opensm/osm_sw_info_rcv.c         |    7 +----
 osm/opensm/osm_ucast_file.c          |   14 +++--------
 osm/opensm/osm_ucast_mgr.c           |    7 +----
 10 files changed, 48 insertions(+), 86 deletions(-)

diff --git a/osm/opensm/osm_drop_mgr.c b/osm/opensm/osm_drop_mgr.c
index 089f312..0a300c1 100644
--- a/osm/opensm/osm_drop_mgr.c
+++ b/osm/opensm/osm_drop_mgr.c
@@ -486,7 +486,6 @@ __osm_drop_mgr_check_node(
   IN osm_node_t* p_node )
 {
   osm_switch_t *p_sw;
-  cl_qmap_t* p_sw_guid_tbl;
   ib_net64_t node_guid;
   osm_physp_t *p_physp;
   osm_port_t *p_port;
@@ -506,11 +505,9 @@ __osm_drop_mgr_check_node(
     goto Exit;
   }
 
-  p_sw_guid_tbl = &p_mgr->p_subn->sw_guid_tbl;
-
   /* Make sure we have a switch object for this node */
-  p_sw = (osm_switch_t*)cl_qmap_get( p_sw_guid_tbl, node_guid );
-  if (p_sw == (osm_switch_t*)cl_qmap_end( p_sw_guid_tbl ) )
+  p_sw = osm_get_switch_by_guid( p_mgr->p_subn, node_guid );
+  if (!p_sw)
   {
     /* We do not have switch info for this node */
     osm_log( p_mgr->p_log, OSM_LOG_VERBOSE,
diff --git a/osm/opensm/osm_lin_fwd_rcv.c b/osm/opensm/osm_lin_fwd_rcv.c
index e604747..218fd56 100644
--- a/osm/opensm/osm_lin_fwd_rcv.c
+++ b/osm/opensm/osm_lin_fwd_rcv.c
@@ -108,7 +108,6 @@ osm_lft_rcv_process(
   IN const osm_lft_rcv_t* const p_rcv,
   IN osm_madw_t* const p_madw )
 {
-  cl_qmap_t *p_sw_tbl;
   ib_smp_t *p_smp;
   uint32_t block_num;
   osm_switch_t *p_sw;
@@ -123,7 +122,6 @@ osm_lft_rcv_process(
 
   CL_ASSERT( p_madw );
 
-  p_sw_tbl = &p_rcv->p_subn->sw_guid_tbl;
   p_smp = osm_madw_get_smp_ptr( p_madw );
   p_block = (uint8_t*)ib_smp_get_payload_ptr( p_smp );
   block_num = cl_ntoh32( p_smp->attr_mod );
@@ -135,9 +133,9 @@ osm_lft_rcv_process(
   node_guid = p_lft_context->node_guid;
 
   CL_PLOCK_EXCL_ACQUIRE( p_rcv->p_lock );
-  p_sw = (osm_switch_t*)cl_qmap_get( p_sw_tbl, node_guid );
+  p_sw = osm_get_switch_by_guid( p_rcv->p_subn, node_guid );
 
-  if( p_sw == (osm_switch_t*)cl_qmap_end( p_sw_tbl ) )
+  if( !p_sw )
   {
     osm_log( p_rcv->p_log, OSM_LOG_ERROR,
              "osm_lft_rcv_process: ERR 0401: "
diff --git a/osm/opensm/osm_mcast_fwd_rcv.c b/osm/opensm/osm_mcast_fwd_rcv.c
index cab0dfa..e2a55e2 100644
--- a/osm/opensm/osm_mcast_fwd_rcv.c
+++ b/osm/opensm/osm_mcast_fwd_rcv.c
@@ -114,7 +114,6 @@ osm_mft_rcv_process(
   IN const osm_mft_rcv_t* const p_rcv,
   IN osm_madw_t* const p_madw )
 {
-  cl_qmap_t *p_sw_tbl;
   ib_smp_t *p_smp;
   uint32_t block_num;
   uint8_t position;
@@ -130,7 +129,6 @@ osm_mft_rcv_process(
 
   CL_ASSERT( p_madw );
 
-  p_sw_tbl = &p_rcv->p_subn->sw_guid_tbl;
   p_smp = osm_madw_get_smp_ptr( p_madw );
   p_block = (uint16_t*)ib_smp_get_payload_ptr( p_smp );
   block_num = cl_ntoh32( p_smp->attr_mod ) & IB_MCAST_BLOCK_ID_MASK_HO;
@@ -154,9 +152,9 @@ osm_mft_rcv_process(
   }
 
   CL_PLOCK_EXCL_ACQUIRE( p_rcv->p_lock );
-  p_sw = (osm_switch_t*)cl_qmap_get( p_sw_tbl, node_guid );
+  p_sw = osm_get_switch_by_guid( p_rcv->p_subn, node_guid );
 
-  if( p_sw == (osm_switch_t*)cl_qmap_end( p_sw_tbl ) )
+  if( !p_sw )
   {
     osm_log( p_rcv->p_log, OSM_LOG_ERROR,
              "osm_mft_rcv_process: ERR 0801: "
diff --git a/osm/opensm/osm_mcast_mgr.c b/osm/opensm/osm_mcast_mgr.c
index 5cb97be..26d53cd 100644
--- a/osm/opensm/osm_mcast_mgr.c
+++ b/osm/opensm/osm_mcast_mgr.c
@@ -656,7 +656,6 @@ __osm_mcast_mgr_branch(
   osm_mtree_node_t*        p_mtn = NULL;
   cl_qlist_t*              list_array = NULL;
   uint8_t                  i;
-  cl_qmap_t*               p_sw_guid_tbl;
   ib_net64_t               node_guid;
   uint64_t              node_guid_ho;
   osm_mcast_work_obj_t*    p_wobj;
@@ -731,8 +730,6 @@ __osm_mcast_mgr_branch(
     goto Exit;
   }
 
-  p_sw_guid_tbl = &p_mgr->p_subn->sw_guid_tbl;
-
   max_children = osm_mtree_node_get_max_children( p_mtn );
 
   CL_ASSERT( max_children > 1 );
@@ -836,8 +833,8 @@ __osm_mcast_mgr_branch(
       /*
         Acquire a pointer to the remote switch then recurse.
       */
-      p_remote_sw = (osm_switch_t*)cl_qmap_get(
-        p_sw_guid_tbl, osm_node_get_node_guid( p_remote_node ) );
+      p_remote_sw = osm_get_switch_by_guid(p_mgr->p_subn,
+                                osm_node_get_node_guid( p_remote_node ) );
       CL_ASSERT( p_remote_sw );
 
       p_physp = osm_node_get_physp_ptr( p_node, i );
@@ -1076,7 +1073,7 @@ __osm_mcast_mgr_clear(
   IN osm_mgrp_t*           const p_mgrp )
 {
   osm_switch_t*            p_sw;
-  cl_qmap_t*               p_tbl;
+  cl_qmap_t*               p_sw_tbl;
   osm_mcast_tbl_t*         p_mcast_tbl;
 
   OSM_LOG_ENTER( p_mgr->p_log, __osm_mcast_mgr_clear );
@@ -1085,9 +1082,9 @@ __osm_mcast_mgr_clear(
     Walk the switches and clear the routing entries for
     this MLID.
   */
-  p_tbl = &p_mgr->p_subn->sw_guid_tbl;
-  p_sw = (osm_switch_t*)cl_qmap_head( p_tbl );
-  while( p_sw != (osm_switch_t*)cl_qmap_end( p_tbl ) )
+  p_sw_tbl = &p_mgr->p_subn->sw_guid_tbl;
+  p_sw = (osm_switch_t*)cl_qmap_head( p_sw_tbl );
+  while( p_sw != (osm_switch_t*)cl_qmap_end( p_sw_tbl ) )
   {
     p_mcast_tbl = osm_switch_get_mcast_tbl_ptr( p_sw );
     osm_mcast_tbl_clear_mlid( p_mcast_tbl, cl_ntoh16(p_mgrp->mlid) );
@@ -1118,7 +1115,6 @@ osm_mcast_mgr_process_single(
   osm_physp_t*             p_remote_physp;
   osm_node_t*              p_remote_node;
   cl_qmap_t*               p_port_tbl;
-  cl_qmap_t*               p_sw_tbl;
   osm_mcast_tbl_t*         p_mcast_tbl;
   ib_api_status_t          status = IB_SUCCESS;
 
@@ -1128,7 +1124,6 @@ osm_mcast_mgr_process_single(
   CL_ASSERT( port_guid );
 
   p_port_tbl = &p_mgr->p_subn->port_guid_tbl;
-  p_sw_tbl = &p_mgr->p_subn->sw_guid_tbl;
   mlid_ho = cl_ntoh16( mlid );
 
   if( osm_log_is_active( p_mgr->p_log, OSM_LOG_DEBUG ) )
@@ -1215,8 +1210,8 @@ osm_mcast_mgr_process_single(
     goto Exit;
   }
 
-  p_sw = (osm_switch_t*)cl_qmap_get( p_sw_tbl, sw_guid );
-  if( p_sw == (osm_switch_t*)cl_qmap_end( p_sw_tbl ) )
+  p_sw = osm_get_switch_by_guid( p_mgr->p_subn, sw_guid );
+  if( !p_sw )
   {
     osm_log( p_mgr->p_log, OSM_LOG_ERROR,
              "osm_mcast_mgr_process_single: ERR 0A12: "
@@ -1295,14 +1290,12 @@ osm_mcast_mgr_process_tree(
   ib_net64_t                     port_guid )
 {
   ib_api_status_t          status = IB_SUCCESS;
-  cl_qmap_t*               p_tbl;
   ib_net16_t               mlid;
   boolean_t                ui_mcast_fdb_assign_func_defined;
 
   OSM_LOG_ENTER( p_mgr->p_log, osm_mcast_mgr_process_tree );
 
   mlid = osm_mgrp_get_mlid( p_mgrp );
-  p_tbl = &p_mgr->p_subn->sw_guid_tbl;
 
   if( osm_log_is_active( p_mgr->p_log, OSM_LOG_DEBUG ) )
   {
@@ -1505,12 +1498,12 @@ osm_mcast_mgr_process_mgrp(
   osm_signal_t          signal = OSM_SIGNAL_DONE;
   ib_api_status_t          status;
   osm_switch_t*            p_sw;
-  cl_qmap_t*               p_tbl;
+  cl_qmap_t*               p_sw_tbl;
   boolean_t             pending_transactions = FALSE;
 
   OSM_LOG_ENTER( p_mgr->p_log, osm_mcast_mgr_process_mgrp );
 
-  p_tbl = &p_mgr->p_subn->sw_guid_tbl;
+  p_sw_tbl = &p_mgr->p_subn->sw_guid_tbl;
 
   status = osm_mcast_mgr_process_tree( p_mgr, p_mgrp, req_type, port_guid );
   if( status != IB_SUCCESS )
@@ -1526,8 +1519,8 @@ osm_mcast_mgr_process_mgrp(
   /*
     Walk the switches and download the tables for each.
   */
-  p_sw = (osm_switch_t*)cl_qmap_head( p_tbl );
-  while( p_sw != (osm_switch_t*)cl_qmap_end( p_tbl ) )
+  p_sw = (osm_switch_t*)cl_qmap_head( p_sw_tbl );
+  while( p_sw != (osm_switch_t*)cl_qmap_end( p_sw_tbl ) )
   {
     signal = __osm_mcast_mgr_set_tbl( p_mgr, p_sw );
     if( signal == OSM_SIGNAL_DONE_PENDING )
@@ -1555,7 +1548,7 @@ osm_mcast_mgr_process(
 {
   osm_signal_t          signal;
   osm_switch_t*            p_sw;
-  cl_qmap_t*               p_tbl;
+  cl_qmap_t*               p_sw_tbl;
   cl_qmap_t*               p_mcast_tbl;
   osm_mgrp_t*              p_mgrp;
   ib_api_status_t          status;
@@ -1563,7 +1556,7 @@ osm_mcast_mgr_process(
 
   OSM_LOG_ENTER( p_mgr->p_log, osm_mcast_mgr_process );
 
-  p_tbl = &p_mgr->p_subn->sw_guid_tbl;
+  p_sw_tbl = &p_mgr->p_subn->sw_guid_tbl;
 
   p_mcast_tbl = &p_mgr->p_subn->mgrp_mlid_tbl;
   /*
@@ -1596,8 +1589,8 @@ osm_mcast_mgr_process(
   /*
     Walk the switches and download the tables for each.
   */
-  p_sw = (osm_switch_t*)cl_qmap_head( p_tbl );
-  while( p_sw != (osm_switch_t*)cl_qmap_end( p_tbl ) )
+  p_sw = (osm_switch_t*)cl_qmap_head( p_sw_tbl );
+  while( p_sw != (osm_switch_t*)cl_qmap_end( p_sw_tbl ) )
   {
     signal = __osm_mcast_mgr_set_tbl( p_mgr, p_sw );
     if( signal == OSM_SIGNAL_DONE_PENDING )
diff --git a/osm/opensm/osm_node_info_rcv.c b/osm/opensm/osm_node_info_rcv.c
index 1d337a8..74ca24b 100644
--- a/osm/opensm/osm_node_info_rcv.c
+++ b/osm/opensm/osm_node_info_rcv.c
@@ -642,7 +642,6 @@ __osm_ni_rcv_process_existing_switch(
   IN osm_node_t* const p_node,
   IN const osm_madw_t* const p_madw )
 {
-  cl_qmap_t *p_sw_guid_tbl;
   ib_net64_t node_guid;
   osm_switch_t *p_sw;
 
@@ -661,12 +660,9 @@ __osm_ni_rcv_process_existing_switch(
   else
   {
     /* Make sure we have SwitchInfo on this node */
-    p_sw_guid_tbl = &p_rcv->p_subn->sw_guid_tbl;
     node_guid = osm_node_get_node_guid( p_node );
-    p_sw = (osm_switch_t*)cl_qmap_get( p_sw_guid_tbl,
-                                       node_guid );
-    if( p_sw == (osm_switch_t*)cl_qmap_end( p_sw_guid_tbl ) ||
-        osm_switch_discovery_count_get( p_sw ) == 0 )
+    p_sw = osm_get_switch_by_guid( p_rcv->p_subn, node_guid );
+    if( !p_sw || osm_switch_discovery_count_get( p_sw ) == 0 )
     {
       /* we don't have the SwitchInfo - retry to get it */
       osm_log( p_rcv->p_log, OSM_LOG_DEBUG,
diff --git a/osm/opensm/osm_sa_multipath_record.c b/osm/opensm/osm_sa_multipath_record.c
index 8f9cc37..c0fe9c3 100644
--- a/osm/opensm/osm_sa_multipath_record.c
+++ b/osm/opensm/osm_sa_multipath_record.c
@@ -241,7 +241,6 @@ __osm_mpr_rcv_get_path_parms(
   const osm_switch_t*		p_sw;
   const osm_prtn_t*		p_prtn;
   const ib_port_info_t*		p_pi;
-  const cl_qmap_t*		p_sw_tbl;
   ib_slvl_table_t*            	p_slvl_tbl;
   ib_api_status_t		status = IB_SUCCESS;
   uint8_t			mtu;
@@ -264,7 +263,6 @@ __osm_mpr_rcv_get_path_parms(
   p_dest_physp = osm_port_get_default_phys_ptr( p_dest_port );
   p_physp = osm_port_get_default_phys_ptr( p_src_port );
   p_pi = osm_physp_get_port_info_ptr( p_physp );
-  p_sw_tbl = &p_rcv->p_subn->sw_guid_tbl;
 
   mtu = ib_port_info_get_mtu_cap( p_pi );
   rate = ib_port_info_compute_rate( p_pi );
@@ -356,10 +354,9 @@ __osm_mpr_rcv_get_path_parms(
 
   if ( osm_node_get_type( p_node ) == IB_NODE_TYPE_SWITCH )
   {
-    p_sw = (osm_switch_t *)cl_qmap_get( p_sw_tbl,
-					osm_node_get_node_guid( p_node ) );
-
-    if( p_sw == (osm_switch_t *)cl_qmap_end( p_sw_tbl ) )
+    p_sw = osm_get_switch_by_guid( p_rcv->p_subn,
+				   osm_node_get_node_guid( p_node ) );
+    if( !p_sw )
     {
       status = IB_ERROR;
       goto Exit;
@@ -389,10 +386,9 @@ __osm_mpr_rcv_get_path_parms(
 	
   if ( osm_node_get_type( p_node ) == IB_NODE_TYPE_SWITCH )
   {
-    p_sw = (osm_switch_t *)cl_qmap_get( p_sw_tbl,
-					osm_node_get_node_guid( p_node ) );
-
-    if ( p_sw == (osm_switch_t *)cl_qmap_end( p_sw_tbl ) )
+    p_sw = osm_get_switch_by_guid( p_rcv->p_subn,
+				   osm_node_get_node_guid( p_node ) );
+    if( !p_sw )
     {
       status = IB_ERROR;
       goto Exit;
@@ -453,9 +449,9 @@ __osm_mpr_rcv_get_path_parms(
     }
 
     node_guid = osm_node_get_node_guid( p_node );
-    p_sw = (osm_switch_t*)cl_qmap_get( p_sw_tbl, node_guid );
+    p_sw = osm_get_switch_by_guid( p_rcv->p_subn, node_guid );
 
-    if ( p_sw == (osm_switch_t*)cl_qmap_end( p_sw_tbl ) )
+    if( !p_sw )
     {
       /*
         There is some sort of problem in the subnet object!
diff --git a/osm/opensm/osm_sa_path_record.c b/osm/opensm/osm_sa_path_record.c
index 72f8a89..d99df21 100644
--- a/osm/opensm/osm_sa_path_record.c
+++ b/osm/opensm/osm_sa_path_record.c
@@ -242,7 +242,6 @@ __osm_pr_rcv_get_path_parms(
   const osm_switch_t*      p_sw;
   const osm_prtn_t*        p_prtn;
   const ib_port_info_t*    p_pi;
-  const cl_qmap_t*         p_sw_tbl;
   ib_api_status_t          status = IB_SUCCESS;
   ib_net16_t               pkey;
   uint8_t                  mtu;
@@ -261,7 +260,6 @@ __osm_pr_rcv_get_path_parms(
   p_dest_physp = osm_port_get_default_phys_ptr( p_dest_port );
   p_physp = osm_port_get_default_phys_ptr( p_src_port );
   p_pi = osm_physp_get_port_info_ptr( p_physp );
-  p_sw_tbl = &p_rcv->p_subn->sw_guid_tbl;
 
   mtu = ib_port_info_get_mtu_cap( p_pi );
   rate = ib_port_info_compute_rate( p_pi );
@@ -295,10 +293,9 @@ __osm_pr_rcv_get_path_parms(
 
   if( osm_node_get_type( p_node ) == IB_NODE_TYPE_SWITCH )
   {
-    p_sw = (osm_switch_t *)cl_qmap_get( p_sw_tbl,
-                                        osm_node_get_node_guid( p_node ) );
-
-    if( p_sw == (osm_switch_t *)cl_qmap_end( p_sw_tbl ) )
+    p_sw = osm_get_switch_by_guid(p_rcv->p_subn,
+                                  osm_node_get_node_guid( p_node ) );
+    if( !p_sw )
     {
       status = IB_ERROR;
       goto Exit;
@@ -328,10 +325,9 @@ __osm_pr_rcv_get_path_parms(
 
   if( osm_node_get_type( p_node ) == IB_NODE_TYPE_SWITCH )
   {
-    p_sw = (osm_switch_t *)cl_qmap_get( p_sw_tbl,
-                                        osm_node_get_node_guid( p_node ) );
-
-    if( p_sw == (osm_switch_t *)cl_qmap_end( p_sw_tbl ) )
+    p_sw = osm_get_switch_by_guid(p_rcv->p_subn,
+                                  osm_node_get_node_guid( p_node ) );
+    if( !p_sw )
     {
       status = IB_ERROR;
       goto Exit;
@@ -390,9 +386,9 @@ __osm_pr_rcv_get_path_parms(
     }
 
     node_guid = osm_node_get_node_guid( p_node );
-    p_sw = (osm_switch_t*)cl_qmap_get( p_sw_tbl, node_guid );
+    p_sw = osm_get_switch_by_guid(p_rcv->p_subn, node_guid );
 
-    if( p_sw == (osm_switch_t*)cl_qmap_end( p_sw_tbl ) )
+    if( !p_sw )
     {
       /*
         There is some sort of problem in the subnet object!
diff --git a/osm/opensm/osm_sw_info_rcv.c b/osm/opensm/osm_sw_info_rcv.c
index d32364f..6de06ea 100644
--- a/osm/opensm/osm_sw_info_rcv.c
+++ b/osm/opensm/osm_sw_info_rcv.c
@@ -586,7 +586,6 @@ osm_si_rcv_process(
   IN osm_madw_t* const p_madw )
 {
   cl_qmap_t *p_node_guid_tbl;
-  cl_qmap_t *p_sw_guid_tbl;
   ib_switch_info_t *p_si;
   ib_smp_t *p_smp;
   osm_node_t *p_node;
@@ -601,7 +600,6 @@ osm_si_rcv_process(
   CL_ASSERT( p_madw );
 
   p_node_guid_tbl = &p_rcv->p_subn->node_guid_tbl;
-  p_sw_guid_tbl = &p_rcv->p_subn->sw_guid_tbl;
   p_smp = osm_madw_get_smp_ptr( p_madw );
   p_si = (ib_switch_info_t*)ib_smp_get_payload_ptr( p_smp );
 
@@ -657,9 +655,8 @@ osm_si_rcv_process(
     /*
       Acquire the switch object for this switch.
     */
-    p_sw = (osm_switch_t*)cl_qmap_get( p_sw_guid_tbl,
-                                       node_guid );
-    if( p_sw == (osm_switch_t*)cl_qmap_end( p_sw_guid_tbl ) )
+    p_sw = osm_get_switch_by_guid( p_rcv->p_subn, node_guid );
+    if( !p_sw )
     {
       __osm_si_rcv_process_new( p_rcv, p_node, p_madw );
       /*
diff --git a/osm/opensm/osm_ucast_file.c b/osm/opensm/osm_ucast_file.c
index e844faa..0992a8a 100644
--- a/osm/opensm/osm_ucast_file.c
+++ b/osm/opensm/osm_ucast_file.c
@@ -212,11 +212,8 @@ static int do_ucast_file_load(void *cont
 			}
 			sw_guid = cl_hton64(sw_guid);
 
-			p_sw = (osm_switch_t *)cl_qmap_get(&p_osm->subn.sw_guid_tbl,
-							   sw_guid);
-			if (!p_sw ||
-			    p_sw == (osm_switch_t *)cl_qmap_end(&p_osm->subn.sw_guid_tbl)) {
-				p_sw = NULL;
+			p_sw = osm_get_switch_by_guid(&p_osm->subn, sw_guid);
+			if (!p_sw) {
 				osm_log(&p_osm->log, OSM_LOG_VERBOSE,
 					"do_ucast_file_load: "
 					"cannot find switch %016" PRIx64 "\n",
@@ -343,11 +340,8 @@ static int do_lid_matrix_file_load(void
 			}
 			guid = cl_hton64(guid);
 
-			p_sw = (osm_switch_t *)cl_qmap_get(&p_osm->subn.sw_guid_tbl,
-							   guid);
-			if (!p_sw ||
-			    p_sw == (osm_switch_t *)cl_qmap_end(&p_osm->subn.sw_guid_tbl)) {
-				p_sw = NULL;
+			p_sw = osm_get_switch_by_guid(&p_osm->subn, guid);
+			if (!p_sw) {
 				osm_log(&p_osm->log, OSM_LOG_VERBOSE,
 					"do_lid_matrix_file_load: "
 					"cannot find switch %016" PRIx64 "\n",
diff --git a/osm/opensm/osm_ucast_mgr.c b/osm/opensm/osm_ucast_mgr.c
index ee04f0e..0827901 100644
--- a/osm/opensm/osm_ucast_mgr.c
+++ b/osm/opensm/osm_ucast_mgr.c
@@ -1107,11 +1107,8 @@ __osm_ucast_mgr_process_neighbors(
 
       remote_node_guid = osm_node_get_node_guid( p_remote_node );
 
-      p_remote_sw = (osm_switch_t*)cl_qmap_get(
-        &p_mgr->p_subn->sw_guid_tbl, remote_node_guid );
-
-      if( p_remote_sw == (osm_switch_t*)cl_qmap_end(
-            &p_mgr->p_subn->sw_guid_tbl ) )
+      p_remote_sw = osm_get_switch_by_guid( p_mgr->p_subn, remote_node_guid );
+      if( !p_remote_sw )
       {
         osm_log( p_mgr->p_log, OSM_LOG_ERROR,
                  "__osm_ucast_mgr_process_neighbors: ERR 3A07: "
-- 
1.4.4





More information about the general mailing list