[openib-general] [PATCH 2/2] osm: osmtest ignores error status

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Thu Sep 28 08:20:28 PDT 2006


Hi Hal.

This patch takes care of several cases where osmtest
ignored error status (plus some cosmetics).

Yevgeny

Signed-off-by:  Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>

Index: osmt_service.c
===================================================================
--- osmt_service.c	(revision 9661)
+++ osmt_service.c	(working copy)
@@ -60,6 +60,9 @@
 #include <complib/cl_debug.h>
 #include "osmtest.h"
 
+/**********************************************************************
+ **********************************************************************/
+
 ib_api_status_t
 osmt_register_service( IN osmtest_t * const p_osmt,
                        IN ib_net64_t      service_id,
@@ -174,6 +177,9 @@ osmt_register_service( IN osmtest_t * co
   return status;
 }
 
+/**********************************************************************
+ **********************************************************************/
+
 ib_api_status_t
 osmt_register_service_with_full_key ( IN osmtest_t * const p_osmt,
                                       IN ib_net64_t      service_id,
@@ -260,6 +266,23 @@ osmt_register_service_with_full_key ( IN
   }
 
   status = context.result.status;
+  if( status != IB_SUCCESS )
+  {
+    osm_log( &p_osmt->log, OSM_LOG_ERROR,
+             "osmt_register_service_with_full_key: ERR 4A04: "
+             "ib_query failed (%s)\n", ib_get_err_str( status ) );
+
+    if( status == IB_REMOTE_ERROR )
+    {
+      osm_log( &p_osmt->log, OSM_LOG_ERROR,
+               "osmt_register_service_with_full_key: "
+               "Remote error = %s\n",
+               ib_get_mad_status_str( osm_madw_get_mad_ptr
+                                      ( context.result.
+                                        p_result_madw ) ) );
+    }
+    goto Exit;
+  }
 
   /*  Check service key on context to see if match */
   p_rec = osmv_get_query_svc_rec( context.result.p_result_madw, 0 );
@@ -277,30 +300,12 @@ osmt_register_service_with_full_key ( IN
   {
     status = IB_REMOTE_ERROR;
     osm_log( &p_osmt->log, OSM_LOG_ERROR,
-             "osmt_register_service_with_full_key:"
+             "osmt_register_service_with_full_key: ERR 4A34: "
              "Data mismatch in service_key\n"
              );
     goto Exit;
   }
 
-  if( status != IB_SUCCESS )
-  {
-    osm_log( &p_osmt->log, OSM_LOG_ERROR,
-             "osmt_register_service_with_full_key: ERR 4A04: "
-             "ib_query failed (%s)\n", ib_get_err_str( status ) );
-
-    if( status == IB_REMOTE_ERROR )
-    {
-      osm_log( &p_osmt->log, OSM_LOG_ERROR,
-               "osmt_register_service_with_full_key: "
-               "Remote error = %s\n",
-               ib_get_mad_status_str( osm_madw_get_mad_ptr
-                                      ( context.result.
-                                        p_result_madw ) ) );
-    }
-    goto Exit;
-  }
-
  Exit:
   if( context.result.p_result_madw != NULL )
   {
@@ -312,6 +317,9 @@ osmt_register_service_with_full_key ( IN
   return status;
 }
 
+/**********************************************************************
+ **********************************************************************/
+
 ib_api_status_t
 osmt_register_service_with_data( IN osmtest_t * const p_osmt,
                                  IN ib_net64_t      service_id,
@@ -478,6 +486,9 @@ osmt_register_service_with_data( IN osmt
   return status;
 }
 
+/**********************************************************************
+ **********************************************************************/
+
 ib_api_status_t
 osmt_get_service_by_id_and_name ( IN osmtest_t * const p_osmt,
                                   IN uint32_t rec_num,
@@ -618,6 +629,9 @@ osmt_get_service_by_id_and_name ( IN osm
   return status;
 }
 
+/**********************************************************************
+ **********************************************************************/
+
 ib_api_status_t
 osmt_get_service_by_id ( IN osmtest_t * const p_osmt,
                          IN uint32_t rec_num,
@@ -755,6 +769,9 @@ osmt_get_service_by_id ( IN osmtest_t * 
   return status;
 }
 
+/**********************************************************************
+ **********************************************************************/
+
 ib_api_status_t
 osmt_get_service_by_name_and_key ( IN osmtest_t * const p_osmt,
                                    IN char * sr_name,
@@ -907,6 +924,9 @@ osmt_get_service_by_name_and_key ( IN os
   return status;
 }
 
+/**********************************************************************
+ **********************************************************************/
+
 ib_api_status_t
 osmt_get_service_by_name( IN osmtest_t * const p_osmt,
                           IN char * sr_name,
@@ -1036,6 +1056,9 @@ osmt_get_service_by_name( IN osmtest_t *
   return status;
 }
 
+/**********************************************************************
+ **********************************************************************/
+
 #ifdef VENDOR_RMPP_SUPPORT
 ib_api_status_t
 osmt_get_all_services_and_check_names( IN osmtest_t * const p_osmt,
@@ -1170,6 +1193,9 @@ osmt_get_all_services_and_check_names( I
 }
 #endif
 
+/**********************************************************************
+ **********************************************************************/
+
 ib_api_status_t
 osmt_delete_service_by_name(IN osmtest_t * const p_osmt,
                             IN uint8_t IsServiceExist,
@@ -1293,6 +1319,9 @@ osmt_delete_service_by_name(IN osmtest_t
   return status;
 }
 
+/**********************************************************************
+ **********************************************************************/
+
 /*
  * Run a complete service records flow:
  * - register a service





More information about the general mailing list