[openib-general] [PATCH][MINOR] OpenSM/SA: Indicate unsupported method/attribute rather than invalid request in SA response

Hal Rosenstock halr at voltaire.com
Wed Jul 5 06:08:57 PDT 2006


OpenSM/SA: Indicate unsupported method/attribute rather than invalid
request in SA response

When method/attribute is unsupported, indicate this error rather than
more generic invalid request error.

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

Index: opensm/osm_sa_guidinfo_record.c
===================================================================
--- opensm/osm_sa_guidinfo_record.c	(revision 8365)
+++ opensm/osm_sa_guidinfo_record.c	(working copy)
@@ -445,7 +445,7 @@ osm_gir_rcv_process(
              "osm_gir_rcv_process: ERR 5105: "
              "Unsupported Method (%s)\n",
              ib_get_sa_method_str( p_rcvd_mad->method ) );
-    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID );
+    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_MAD_STATUS_UNSUP_METHOD_ATTR );
     goto Exit;
   }
 
Index: opensm/osm_sa_vlarb_record.c
===================================================================
--- opensm/osm_sa_vlarb_record.c	(revision 8365)
+++ opensm/osm_sa_vlarb_record.c	(working copy)
@@ -372,7 +372,7 @@ osm_vlarb_rec_rcv_process(
              "osm_vlarb_rec_rcv_process: ERR 2A05: "
              "Unsupported Method (%s)\n",
              ib_get_sa_method_str( p_rcvd_mad->method ) );
-    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID );
+    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_MAD_STATUS_UNSUP_METHOD_ATTR );
     goto Exit;
   }
 
Index: opensm/osm_sa_multipath_record.c
===================================================================
--- opensm/osm_sa_multipath_record.c	(revision 8365)
+++ opensm/osm_sa_multipath_record.c	(working copy)
@@ -1444,7 +1444,7 @@ osm_mpr_rcv_process(
   {
     osm_log( p_rcv->p_log, OSM_LOG_ERROR,
              "osm_mpr_rcv_process: ERR 4510: "
-             "Invalid request as RMPP_FLAG_ACTIVE is not set\n" );
+             "Invalid request since RMPP_FLAG_ACTIVE is not set\n" );
     osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID );
     goto Exit;
   }
@@ -1454,7 +1454,7 @@ osm_mpr_rcv_process(
 	     "osm_mpr_rcv_process: ERR 4513: "
 	     "Unsupported Method (%s)\n",
 	     ib_get_sa_method_str( p_sa_mad->method ) );
-    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID );
+    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_MAD_STATUS_UNSUP_METHOD_ATTR );
     goto Exit;
   }
 
Index: opensm/osm_sa_lft_record.c
===================================================================
--- opensm/osm_sa_lft_record.c	(revision 8365)
+++ opensm/osm_sa_lft_record.c	(working copy)
@@ -353,7 +353,7 @@ osm_lftr_rcv_process(
              "osm_lftr_rcv_process: ERR 4408: "
              "Unsupported Method (%s)\n",
              ib_get_sa_method_str( p_rcvd_mad->method ) );
-    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID);
+    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_MAD_STATUS_UNSUP_METHOD_ATTR );
     goto Exit;
   }
 
Index: opensm/osm_sa_service_record.c
===================================================================
--- opensm/osm_sa_service_record.c	(revision 8365)
+++ opensm/osm_sa_service_record.c	(working copy)
@@ -1085,7 +1085,7 @@ osm_sr_rcv_process(
     {
       osm_log( p_rcv->p_log, OSM_LOG_VERBOSE,
                "osm_sr_rcv_process: "
-               "Component Mask check failed\n" );
+               "Component Mask check failed for set request\n" );
       osm_sa_send_error( p_rcv->p_resp, p_madw, sa_status );
       goto Exit;
     }
@@ -1097,7 +1097,7 @@ osm_sr_rcv_process(
     {
       osm_log( p_rcv->p_log, OSM_LOG_DEBUG,
                "osm_sr_rcv_process: "
-               "Component Mask check failed\n" );
+               "Component Mask check failed for delete request\n" );
       osm_sa_send_error( p_rcv->p_resp, p_madw, sa_status );
       goto Exit;
     }
@@ -1110,8 +1110,9 @@ osm_sr_rcv_process(
   default:
     osm_log( p_rcv->p_log, OSM_LOG_DEBUG,
              "osm_sr_rcv_process: "
-             "Bad Method (%s)\n", ib_get_sa_method_str( p_sa_mad->method ) );
-    osm_sa_send_error( p_rcv->p_resp, p_madw, sa_status );
+             "Unsupported Method (%s)\n",
+             ib_get_sa_method_str( p_sa_mad->method ) );
+    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_MAD_STATUS_UNSUP_METHOD_ATTR );
     break;
   }
 
Index: opensm/osm_sa_portinfo_record.c
===================================================================
--- opensm/osm_sa_portinfo_record.c	(revision 8365)
+++ opensm/osm_sa_portinfo_record.c	(working copy)
@@ -657,7 +657,7 @@ osm_pir_rcv_process(
              "osm_pir_rcv_process: ERR 2105: "
              "Unsupported Method (%s)\n",
              ib_get_sa_method_str( p_rcvd_mad->method ) );
-    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID);
+    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_MAD_STATUS_UNSUP_METHOD_ATTR );
     goto Exit;
   }
 
Index: opensm/osm_sa_pkey_record.c
===================================================================
--- opensm/osm_sa_pkey_record.c	(revision 8365)
+++ opensm/osm_sa_pkey_record.c	(working copy)
@@ -367,7 +367,7 @@ osm_pkey_rec_rcv_process(
              "osm_pkey_rec_rcv_process: ERR 4605: "
              "Unsupported Method (%s)\n",
              ib_get_sa_method_str( p_rcvd_mad->method ) );
-    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID );
+    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_MAD_STATUS_UNSUP_METHOD_ATTR );
     goto Exit;
   }
  
Index: opensm/osm_sa_slvl_record.c
===================================================================
--- opensm/osm_sa_slvl_record.c	(revision 8365)
+++ opensm/osm_sa_slvl_record.c	(working copy)
@@ -352,7 +352,7 @@ osm_slvl_rec_rcv_process(
              "osm_slvl_rec_rcv_process: ERR 2604: "
              "Unsupported Method (%s)\n",
              ib_get_sa_method_str( p_rcvd_mad->method ) );
-    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID);
+    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_MAD_STATUS_UNSUP_METHOD_ATTR );
     goto Exit;
   }
 
Index: opensm/osm_sa_sminfo_record.c
===================================================================
--- opensm/osm_sa_sminfo_record.c	(revision 8365)
+++ opensm/osm_sa_sminfo_record.c	(working copy)
@@ -168,7 +168,7 @@ osm_smir_rcv_process(
              "osm_smir_rcv_process: ERR 2804: "
              "Unsupported Method (%s)\n",
              ib_get_sa_method_str( p_sa_mad->method ) );
-    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID );
+    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_MAD_STATUS_UNSUP_METHOD_ATTR );
     goto Exit;
   }
 
Index: opensm/osm_sa_informinfo.c
===================================================================
--- opensm/osm_sa_informinfo.c	(revision 8370)
+++ opensm/osm_sa_informinfo.c	(working copy)
@@ -361,11 +361,7 @@ osm_infr_rcv_process_set_method(
 
 #if 0
   if( osm_log_is_active( p_rcv->p_log, OSM_LOG_DEBUG ) )
-  {
-    osm_dump_inform_info( p_rcv->p_log,
-      p_recvd_inform_info,
-      OSM_LOG_DEBUG );
-  }
+    osm_dump_inform_info( p_rcv->p_log, p_recvd_inform_info, OSM_LOG_DEBUG );
 #endif
 
   /* Grab the lock */
@@ -534,25 +530,25 @@ osm_infr_rcv_process(
   IN const osm_madw_t*     const p_madw )
 {
   ib_sa_mad_t *p_sa_mad;
-  ib_net16_t sa_status = IB_SA_MAD_STATUS_REQ_INVALID;
 
   OSM_LOG_ENTER( p_rcv->p_log, osm_infr_rcv_process );
 
   CL_ASSERT( p_madw );
+
   p_sa_mad = osm_madw_get_sa_mad_ptr( p_madw );
 
-  switch (p_sa_mad->method)
+  CL_ASSERT( p_sa_mad->attr_id == IB_MAD_ATTR_INFORM_INFO );
+
+  if (p_sa_mad->method != IB_MAD_METHOD_SET)
   {
-  case IB_MAD_METHOD_SET:
-    osm_infr_rcv_process_set_method( p_rcv, p_madw );
-    break;
-  default:
     osm_log( p_rcv->p_log, OSM_LOG_DEBUG,
              "osm_infr_rcv_process: "
-             "Bad Method (%s)\n", ib_get_sa_method_str( p_sa_mad->method ));
-    osm_sa_send_error( p_rcv->p_resp, p_madw, sa_status );
-    break;
+             "Unsupported Method (%s)\n",
+             ib_get_sa_method_str( p_sa_mad->method ) );
+    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_MAD_STATUS_UNSUP_METHOD_ATTR );
   }
 
+  osm_infr_rcv_process_set_method( p_rcv, p_madw );
+
   OSM_LOG_EXIT( p_rcv->p_log );
 }
Index: opensm/osm_sa_node_record.c
===================================================================
--- opensm/osm_sa_node_record.c	(revision 8365)
+++ opensm/osm_sa_node_record.c	(working copy)
@@ -445,7 +445,7 @@ osm_nr_rcv_process(
              "osm_nr_rcv_process: ERR 1D05: "
              "Unsupported Method (%s)\n",
              ib_get_sa_method_str( p_rcvd_mad->method ) );
-    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID);
+    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_MAD_STATUS_UNSUP_METHOD_ATTR );
     goto Exit;
   }
 
Index: opensm/osm_sa_link_record.c
===================================================================
--- opensm/osm_sa_link_record.c	(revision 8365)
+++ opensm/osm_sa_link_record.c	(working copy)
@@ -723,7 +723,7 @@ osm_lr_rcv_process(
              "osm_lr_rcv_process: ERR 1804: "
              "Unsupported Method (%s)\n",
              ib_get_sa_method_str( p_sa_mad->method ) );
-    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID );
+    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_MAD_STATUS_UNSUP_METHOD_ATTR );
     goto Exit;
   }
 
Index: opensm/osm_sa_mcmember_record.c
===================================================================
--- opensm/osm_sa_mcmember_record.c	(revision 8365)
+++ opensm/osm_sa_mcmember_record.c	(working copy)
@@ -2372,7 +2372,7 @@ osm_mcmr_rcv_process(
              "osm_mcmr_rcv_process: ERR 1B21: "
              "Unsupported Method (%s)\n",
              ib_get_sa_method_str( p_sa_mad->method ) );
-    osm_sa_send_error( p_rcv->p_resp, p_madw, sa_status );
+    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_MAD_STATUS_UNSUP_METHOD_ATTR );
     break;
   }
 
Index: opensm/Makefile.am
===================================================================
--- opensm/Makefile.am	(revision 8365)
+++ opensm/Makefile.am	(working copy)
@@ -31,7 +31,11 @@ $(srcdir)/../include/opensm/osm_svn_revi
 	fi
 endif
 
+if OSMV_OPENIB
+libopensm_la_CFLAGS = -Wall $(OSMV_CFLAGS) -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
+else
 libopensm_la_CFLAGS = -Wall $(OSMV_CFLAGS) -DVENDOR_RMPP_SUPPORT $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
+endif
 
 if HAVE_LD_VERSION_SCRIPT
 libopensm_version_script = -Wl,--version-script=$(srcdir)/libopensm.map
@@ -87,8 +91,13 @@ opensm_SOURCES = main.c osm_console.c os
 		 osm_ucast_mgr.c osm_ucast_updn.c osm_ucast_file.c \
 		 osm_vl15intf.c osm_vl_arb_rcv.c \
 		 osm_vl_arb_rcv_ctrl.c st.c
+if OSMV_OPENIB
+opensm_CFLAGS = -Wall $(OSMV_CFLAGS) -fno-strict-aliasing -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
+opensm_CXXFLAGS = -Wall $(OSMV_CFLAGS) -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
+else
 opensm_CFLAGS = -Wall $(OSMV_CFLAGS) -fno-strict-aliasing -DVENDOR_RMPP_SUPPORT $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
 opensm_CXXFLAGS = -Wall $(OSMV_CFLAGS) -DVENDOR_RMPP_SUPPORT $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
+endif
 
 # for linking with the simulator client library we have to use g++:
 if OSMV_SIM
Index: opensm/osm_sa_path_record.c
===================================================================
--- opensm/osm_sa_path_record.c	(revision 8365)
+++ opensm/osm_sa_path_record.c	(working copy)
@@ -1684,7 +1684,7 @@ osm_pr_rcv_process(
              "osm_pr_rcv_process: ERR 1F17: " 
              "Unsupported Method (%s)\n",
              ib_get_sa_method_str( p_sa_mad->method ) );
-    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID );
+    osm_sa_send_error( p_rcv->p_resp, p_madw, IB_MAD_STATUS_UNSUP_METHOD_ATTR );
     goto Exit;
   }
 







More information about the general mailing list