[openib-general] [PATCH] OpenSM: Eliminate error on active -> active port state transition

Hal Rosenstock halr at voltaire.com
Thu May 18 12:01:55 PDT 2006


OpenSM: Eliminate error on active -> active port state transition

SM may transition port for armed to active but in the mean time due to
passing a data packet with active enable set, the port may already have
transitioned to active. Active -> active port state transition is
indicated as an error but it isn't really an error so don't indicate
error in the osm log.

Signed-off-by: Hal Rosenstock <halr at voltaire.com>

Index: include/opensm/osm_madw.h
===================================================================
--- include/opensm/osm_madw.h	(revision 7342)
+++ include/opensm/osm_madw.h	(working copy)
@@ -185,6 +185,7 @@ typedef struct _osm_pi_context
   boolean_t			light_sweep;
   boolean_t			update_master_sm_base_lid;
   boolean_t			ignore_errors;
+  boolean_t			active_transition;
 } osm_pi_context_t;
 /*********/
 
Index: opensm/osm_lid_mgr.c
===================================================================
--- opensm/osm_lid_mgr.c	(revision 7324)
+++ opensm/osm_lid_mgr.c	(working copy)
@@ -1191,6 +1191,7 @@ __osm_lid_mgr_set_physp_pi(
   context.pi_context.update_master_sm_base_lid = FALSE;
   context.pi_context.ignore_errors = FALSE;
   context.pi_context.light_sweep = FALSE;
+  context.pi_context.active_transition = FALSE;
 
   /*
     We need to set the cli_rereg bit when we are in first_time_master_sweep for
Index: opensm/osm_link_mgr.c
===================================================================
--- opensm/osm_link_mgr.c	(revision 7336)
+++ opensm/osm_link_mgr.c	(working copy)
@@ -320,7 +320,13 @@ __osm_link_mgr_set_physp_pi(
   if (port_state != IB_LINK_NO_CHANGE &&
       ib_port_info_get_port_state(p_pi) != 
       ib_port_info_get_port_state(p_old_pi) )
+  {
     send_set = TRUE;
+    if (port_state == IB_LINK_ACTIVE)
+      context.pi_context.active_transition = TRUE;
+    else
+      context.pi_context.active_transition = FALSE;
+  }
 
   context.pi_context.node_guid = osm_node_get_node_guid( p_node );
   context.pi_context.port_guid = osm_physp_get_port_guid( p_physp );
Index: opensm/osm_node_info_rcv.c
===================================================================
--- opensm/osm_node_info_rcv.c	(revision 7324)
+++ opensm/osm_node_info_rcv.c	(working copy)
@@ -331,6 +331,7 @@ __osm_ni_rcv_process_new_node(
   context.pi_context.update_master_sm_base_lid = FALSE;
   context.pi_context.ignore_errors = FALSE;
   context.pi_context.light_sweep = FALSE;
+  context.pi_context.active_transition = FALSE;
 
   status = osm_req_get( p_rcv->p_gen_req,
                         osm_physp_get_dr_path_ptr( p_physp ),
Index: opensm/osm_pkey_mgr.c
===================================================================
--- opensm/osm_pkey_mgr.c	(revision 7324)
+++ opensm/osm_pkey_mgr.c	(working copy)
@@ -120,6 +120,7 @@ pkey_mgr_enforce_partition(
    context.pi_context.update_master_sm_base_lid = FALSE;
    context.pi_context.ignore_errors = FALSE;
    context.pi_context.light_sweep = FALSE;
+   context.pi_context.active_transition = FALSE;
 
    return osm_req_set( p_req, osm_physp_get_dr_path_ptr( p_physp ),
                        payload, sizeof(payload),
Index: opensm/osm_port_info_rcv.c
===================================================================
--- opensm/osm_port_info_rcv.c	(revision 7324)
+++ opensm/osm_port_info_rcv.c	(working copy)
@@ -586,6 +586,7 @@ osm_pi_rcv_process_set(
   ib_smp_t *p_smp;
   ib_port_info_t *p_pi;
   osm_pi_context_t *p_context;
+  osm_log_level_t level;
 
   OSM_LOG_ENTER( p_rcv->p_log, osm_pi_rcv_process_set );
 
@@ -605,16 +606,31 @@ osm_pi_rcv_process_set(
   /* check for error */
   if (!p_context->ignore_errors && (cl_ntoh16(p_smp->status) & 0x7fff))
   {
-    osm_log( p_rcv->p_log, OSM_LOG_ERROR,
-             "osm_pi_rcv_process_set: ERR 0F10: "
-             "Received error status for SetResp()\n");
+    /* If port already ACTIVE, don't treat status 7 error as error */
+    if (p_context->active_transition &&
+       (cl_ntoh16(p_smp->status) & 0x7fff) == 0x1c)
+    {
+      level = OSM_LOG_INFO;
+      osm_log( p_rcv->p_log, OSM_LOG_INFO,
+               "osm_pi_rcv_process_set: "
+               "Received error status 0x%x for SetResp() during ACTIVE transition\n",
+               cl_ntoh16(p_smp->status) & 0x7fff);
+      /* Should there be a subsequent Get to validate that port is ACTIVE ? */
+    }
+    else
+    {
+      level = OSM_LOG_ERROR;
+      osm_log( p_rcv->p_log, OSM_LOG_ERROR,
+               "osm_pi_rcv_process_set: ERR 0F10: "
+               "Received error status for SetResp()\n");
+    }
     osm_dump_port_info(
       p_rcv->p_log,
       osm_node_get_node_guid( p_node ),
       port_guid,
       port_num,
       p_pi,
-      OSM_LOG_ERROR);
+      level);
   }
 
   if( osm_log_is_active( p_rcv->p_log, OSM_LOG_DEBUG ) )
Index: opensm/osm_qos.c
===================================================================
--- opensm/osm_qos.c	(revision 7324)
+++ opensm/osm_qos.c	(working copy)
@@ -260,6 +260,7 @@ static ib_api_status_t vl_high_limit_upd
 	context.pi_context.update_master_sm_base_lid = FALSE;
 	context.pi_context.ignore_errors = FALSE;
 	context.pi_context.light_sweep = FALSE;
+	context.pi_context.active_transition = FALSE;
 
 	return osm_req_set(p_req, osm_physp_get_dr_path_ptr(p),
 			   payload, sizeof(payload), IB_MAD_ATTR_PORT_INFO,
Index: opensm/osm_sm_state_mgr.c
===================================================================
--- opensm/osm_sm_state_mgr.c	(revision 7324)
+++ opensm/osm_sm_state_mgr.c	(working copy)
@@ -187,6 +187,7 @@ __osm_sm_state_mgr_send_local_port_info_
    /*  with the new master lid value. */
    context.pi_context.update_master_sm_base_lid = TRUE;
    context.pi_context.light_sweep = FALSE;
+   context.pi_context.active_transition = FALSE;
 
    status = osm_req_get( p_sm_mgr->p_req,
                          osm_physp_get_dr_path_ptr
Index: opensm/osm_state_mgr.c
===================================================================
--- opensm/osm_state_mgr.c	(revision 7324)
+++ opensm/osm_state_mgr.c	(working copy)
@@ -640,6 +640,7 @@ __osm_state_mgr_get_remote_port_info(
    mad_context.pi_context.light_sweep = TRUE;
    mad_context.pi_context.ignore_errors = FALSE;
    mad_context.pi_context.update_master_sm_base_lid = FALSE;
+   mad_context.pi_context.active_transition = FALSE;
 
    /* note that with some negative logic - if the query failed it means that
     * there is no point in going to heavy sweep */
Index: opensm/osm_sw_info_rcv.c
===================================================================
--- opensm/osm_sw_info_rcv.c	(revision 7324)
+++ opensm/osm_sw_info_rcv.c	(working copy)
@@ -107,6 +107,7 @@ __osm_si_rcv_get_port_info(
   context.pi_context.update_master_sm_base_lid = FALSE;
   context.pi_context.ignore_errors = FALSE;
   context.pi_context.light_sweep = FALSE;
+  context.pi_context.active_transition = FALSE;
 
   num_ports = osm_node_get_num_physp( p_node );
   osm_dr_path_init( &dr_path,







More information about the general mailing list