[openib-general] [PATCH] [MINOR] OpenSM/osm_sm_mad_ctrl.c: Properly handle status based on whether direct routed or LID routed SMP

Hal Rosenstock halr at voltaire.com
Wed Aug 16 08:10:21 PDT 2006


OpenSM/osm_sm_mad_ctrl.c: Properly handle status based on whether direct
routed or LID routed SMP

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

Index: opensm/osm_sm_mad_ctrl.c
===================================================================
--- opensm/osm_sm_mad_ctrl.c	(revision 8934)
+++ opensm/osm_sm_mad_ctrl.c	(working copy)
@@ -34,7 +34,6 @@
  * $Id$
  */
 
-
 /*
  * Abstract:
  *    Implementation of osm_sm_mad_ctrl_t.
@@ -253,12 +252,15 @@ __osm_sm_mad_ctrl_process_get_resp(
 
   p_smp = osm_madw_get_smp_ptr( p_madw );
 
-  if( !ib_smp_is_d( p_smp ) )
+  if( p_smp->mgmt_class == IB_MCLASS_SUBN_DIR )
   {
-    osm_log( p_ctrl->p_log, OSM_LOG_ERROR,
-             "__osm_sm_mad_ctrl_process_get_resp: ERR 3102: "
-             "'D' bit not set in returned SMP\n" );
-    osm_dump_dr_smp( p_ctrl->p_log, p_smp, OSM_LOG_ERROR );
+    if( !ib_smp_is_d( p_smp ) )
+    {
+      osm_log( p_ctrl->p_log, OSM_LOG_ERROR,
+               "__osm_sm_mad_ctrl_process_get_resp: ERR 3102: "
+               "'D' bit not set in returned SMP\n" );
+      osm_dump_dr_smp( p_ctrl->p_log, p_smp, OSM_LOG_ERROR );
+    }
   }
 
   p_old_madw = (osm_madw_t*)transaction_context;
@@ -667,6 +669,7 @@ __osm_sm_mad_ctrl_rcv_callback(
 {
   osm_sm_mad_ctrl_t* p_ctrl = (osm_sm_mad_ctrl_t*)bind_context;
   ib_smp_t* p_smp;
+  ib_net16_t status;
 
   OSM_LOG_ENTER( p_ctrl->p_log, __osm_sm_mad_ctrl_rcv_callback );
 
@@ -717,11 +720,20 @@ __osm_sm_mad_ctrl_rcv_callback(
   if( osm_log_is_active( p_ctrl->p_log, OSM_LOG_FRAMES ) )
     osm_dump_dr_smp( p_ctrl->p_log, p_smp, OSM_LOG_FRAMES );
 
-  if( ib_smp_get_status( p_smp ) != 0 )
+  if( p_smp->mgmt_class == IB_MCLASS_SUBN_DIR )
+  {
+    status = ib_smp_get_status( p_smp );
+  }
+  else
+  {
+    status = p_smp->status;
+  }
+
+  if( status != 0 )
   {
     osm_log( p_ctrl->p_log, OSM_LOG_ERROR,
              "__osm_sm_mad_ctrl_rcv_callback: ERR 3111: "
-             "Error status = 0x%X\n", ib_smp_get_status( p_smp ) );
+             "Error status = 0x%X\n", status );
     osm_dump_dr_smp( p_ctrl->p_log, p_smp, OSM_LOG_ERROR );
   }
 







More information about the general mailing list