[ofa-general] [PATCH] opensm: remove light_sweep_physp_list list

Sasha Khapyorsky sashak at voltaire.com
Tue Aug 14 08:10:04 PDT 2007


Remove light_sweep_physp_list, we have all information in place - no
need for this additional list creation step.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 opensm/include/opensm/osm_subnet.h |    6 -----
 opensm/opensm/osm_drop_mgr.c       |   39 ----------------------------------
 opensm/opensm/osm_state_mgr.c      |   41 +++++++++++++++++++++++++----------
 opensm/opensm/osm_subnet.c         |    5 ----
 4 files changed, 29 insertions(+), 62 deletions(-)

diff --git a/opensm/include/opensm/osm_subnet.h b/opensm/include/opensm/osm_subnet.h
index e8b9f96..277db7a 100644
--- a/opensm/include/opensm/osm_subnet.h
+++ b/opensm/include/opensm/osm_subnet.h
@@ -550,7 +550,6 @@ typedef struct _osm_subn
   cl_qmap_t		   prtn_pkey_tbl;
   cl_qmap_t		   mgrp_mlid_tbl;
   cl_qmap_t		   sm_guid_tbl;
-  cl_list_t                light_sweep_physp_list;
   cl_qlist_t		   sa_sr_list;
   cl_qlist_t		   sa_infr_list;
   cl_ptr_vector_t	   port_lid_tbl;
@@ -603,11 +602,6 @@ typedef struct _osm_subn
 *		Container of pointers to SM objects representing other SMs
 *		on the subnet.
 *
-*	light_sweep_physp_list
-*		A list of all phys ports to scan for a change in remote
-*		side state in next light sweep. These ports are not down
-*		but for some reason the remote side did not answer.
-*
 *	node_lid_tbl
 *		Container of pointers to all Node objects in the subent.
 *		Indexed by node LID.
diff --git a/opensm/opensm/osm_drop_mgr.c b/opensm/opensm/osm_drop_mgr.c
index f61769b..cb9568f 100644
--- a/opensm/opensm/osm_drop_mgr.c
+++ b/opensm/opensm/osm_drop_mgr.c
@@ -528,15 +528,12 @@ osm_drop_mgr_process(
 {
   cl_qmap_t   *p_node_guid_tbl;
   cl_qmap_t   *p_port_guid_tbl;
-  cl_list_t   *p_lsweep_ports;
   osm_port_t  *p_port;
   osm_port_t  *p_next_port;
   osm_node_t  *p_node;
   osm_node_t  *p_next_node;
   ib_net64_t   port_guid;
   ib_net64_t   node_guid;
-  uint8_t      port_num;
-  osm_physp_t *p_physp;
 
   CL_ASSERT( p_mgr );
 
@@ -544,7 +541,6 @@ osm_drop_mgr_process(
 
   p_node_guid_tbl = &p_mgr->p_subn->node_guid_tbl;
   p_port_guid_tbl = &p_mgr->p_subn->port_guid_tbl;
-  p_lsweep_ports = &p_mgr->p_subn->light_sweep_physp_list;
 
   CL_PLOCK_EXCL_ACQUIRE( p_mgr->p_lock );
 
@@ -629,41 +625,6 @@ osm_drop_mgr_process(
       __osm_drop_mgr_remove_port( p_mgr, p_port );
   }
 
-  /*
-     scan through all the ports left - if the port is not DOWN and
-     it does not have a valid remote port - we need to track it for
-     next light sweep scan...
-  */
-  cl_list_remove_all( p_lsweep_ports );
-  p_next_node = (osm_node_t*)cl_qmap_head( p_node_guid_tbl );
-  while( p_next_node != (osm_node_t*)cl_qmap_end( p_node_guid_tbl ) )
-  {
-    p_node = p_next_node;
-    p_next_node = (osm_node_t*)cl_qmap_next( &p_next_node->map_item );
-
-    for (port_num = 1; port_num < osm_node_get_num_physp(p_node); port_num++)
-    {
-      p_physp = osm_node_get_physp_ptr(p_node, port_num);
-      if (osm_physp_is_valid(p_physp) &&
-          (osm_physp_get_port_state(p_physp) != IB_LINK_DOWN) &&
-          ! osm_physp_get_remote(p_physp))
-      {
-        osm_log( p_mgr->p_log, OSM_LOG_ERROR,
-                 "osm_drop_mgr_process: ERR 0108: "
-                 "Unknown remote side for node 0x%016" PRIx64
-                 " port %u. Adding to light sweep sampling list\n",
-                 cl_ntoh64( osm_node_get_node_guid( p_node )),
-                 port_num);
-
-        osm_dump_dr_path(p_mgr->p_log,
-                         osm_physp_get_dr_path_ptr( p_physp ),
-                         OSM_LOG_ERROR);
-
-        cl_list_insert_head( p_lsweep_ports, p_physp );
-      }
-    }
-  }
-
   CL_PLOCK_RELEASE( p_mgr->p_lock );
   OSM_LOG_EXIT( p_mgr->p_log );
 }
diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c
index 17b66d7..28b960c 100644
--- a/opensm/opensm/osm_state_mgr.c
+++ b/opensm/opensm/osm_state_mgr.c
@@ -1011,16 +1011,15 @@ __osm_state_mgr_light_sweep_start(
    ib_api_status_t status = IB_SUCCESS;
    osm_bind_handle_t h_bind;
    cl_qmap_t *p_sw_tbl;
-   cl_list_t *p_no_rem_port_list;
-   cl_list_iterator_t list_iter;
-   uint8_t path_array[IB_SUBNET_PATH_HOPS_MAX];
+   cl_map_item_t *p_next;
+   osm_node_t *p_node;
+   osm_physp_t *p_physp;
+   uint8_t port_num;
 
    OSM_LOG_ENTER( p_mgr->p_log, __osm_state_mgr_light_sweep_start );
 
    p_sw_tbl = &p_mgr->p_subn->sw_guid_tbl;
 
-   memset( path_array, 0, sizeof( path_array ) );
-
    /*
     * First, get the bind handle.
     */
@@ -1034,14 +1033,32 @@ __osm_state_mgr_light_sweep_start(
 
       /* now scan the list of physical ports that were not down but have no remote port */
       CL_PLOCK_ACQUIRE( p_mgr->p_lock );
-      p_no_rem_port_list = &p_mgr->p_subn->light_sweep_physp_list;
-      list_iter = cl_list_head( p_no_rem_port_list );
-      while( list_iter != cl_list_end( p_no_rem_port_list ) )
+      p_next = cl_qmap_head( &p_mgr->p_subn->node_guid_tbl );
+      while( p_next != cl_qmap_end( &p_mgr->p_subn->node_guid_tbl ) )
       {
-         __osm_state_mgr_get_remote_port_info( p_mgr,
-                                               ( osm_physp_t * )
-                                               cl_list_obj( list_iter ) );
-         list_iter = cl_list_next( list_iter );
+         p_node = (osm_node_t *)p_next;
+         p_next = cl_qmap_next( p_next );
+
+         for (port_num = 1; port_num < osm_node_get_num_physp(p_node); port_num++)
+         {
+            p_physp = osm_node_get_physp_ptr(p_node, port_num);
+            if (osm_physp_is_valid(p_physp) &&
+                (osm_physp_get_port_state(p_physp) != IB_LINK_DOWN) &&
+                ! osm_physp_get_remote(p_physp))
+            {
+               osm_log( p_mgr->p_log, OSM_LOG_ERROR,
+                        "osm_drop_mgr_process: ERR 0108: "
+                        "Unknown remote side for node 0x%016" PRIx64
+                        " port %u. Adding to light sweep sampling list\n",
+                        cl_ntoh64( osm_node_get_node_guid( p_node )), port_num);
+
+               osm_dump_dr_path(p_mgr->p_log,
+                                osm_physp_get_dr_path_ptr( p_physp ),
+                                OSM_LOG_ERROR);
+
+               __osm_state_mgr_get_remote_port_info( p_mgr, p_physp );
+            }
+         }
       }
       CL_PLOCK_RELEASE( p_mgr->p_lock );
    }
diff --git a/opensm/opensm/osm_subnet.c b/opensm/opensm/osm_subnet.c
index f95864c..bd612f3 100644
--- a/opensm/opensm/osm_subnet.c
+++ b/opensm/opensm/osm_subnet.c
@@ -95,8 +95,6 @@ osm_subn_construct(
   cl_qmap_init( &p_subn->rtr_guid_tbl );
   cl_qmap_init( &p_subn->prtn_pkey_tbl );
   cl_qmap_init( &p_subn->mgrp_mlid_tbl );
-  cl_list_construct( &p_subn->light_sweep_physp_list );
-  cl_list_init( &p_subn->light_sweep_physp_list, 5 );
 }
 
 /**********************************************************************
@@ -170,9 +168,6 @@ osm_subn_destroy(
     osm_infr_delete( p_infr );
   }
 
-  cl_list_remove_all( &p_subn->light_sweep_physp_list );
-  cl_list_destroy( &p_subn->light_sweep_physp_list );
-
   cl_ptr_vector_destroy( &p_subn->port_lid_tbl );
   cl_map_remove_all(&(p_subn->opt.port_prof_ignore_guids));
   cl_map_destroy(&(p_subn->opt.port_prof_ignore_guids));
-- 
1.5.3.rc2.38.g11308




More information about the general mailing list