[openib-general] [PATCH 3/3] opensm: no_qos global option

Sasha Khapyorsky sashak at voltaire.com
Tue May 9 11:15:52 PDT 2006


This new option '--no_qos' (or '-O') will disable QoS setup globally in
OpenSM.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---

 osm/include/opensm/osm_subnet.h |    1 +
 osm/opensm/main.c               |   10 +++++++++-
 osm/opensm/osm_qos.c            |    3 +++
 osm/opensm/osm_subnet.c         |   11 ++++++++++-
 4 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/osm/include/opensm/osm_subnet.h b/osm/include/opensm/osm_subnet.h
index 0da3f0c..373030d 100644
--- a/osm/include/opensm/osm_subnet.h
+++ b/osm/include/opensm/osm_subnet.h
@@ -263,6 +263,7 @@ typedef struct _osm_subn_opt
   char *                   log_file;
   char *                   partition_config_file;
   boolean_t                no_partition_enforcement;
+  boolean_t                no_qos;
   boolean_t                accum_log_file;
   boolean_t                console;
   cl_map_t                 port_prof_ignore_guids;
diff --git a/osm/opensm/main.c b/osm/opensm/main.c
index aa4bccb..45ea8ca 100644
--- a/osm/opensm/main.c
+++ b/osm/opensm/main.c
@@ -234,6 +234,9 @@ show_usage(void)
           "--Pconfig\n"
           "          This option defines the optional partition configuration file.\n"
 	  "          The default name is \'" OSM_DEFAULT_PARTITION_CONFIG_FILE "\'.\n\n");
+  printf( "-Q\n"
+          "--no_qos\n"
+          "          This option disables QoS setup.\n\n");
   printf( "-N\n"
           "--no_part_enforce\n"
           "          This option disables partition enforcement on switch external ports.\n\n");
@@ -523,7 +526,7 @@ #endif
   boolean_t             cache_options = FALSE;
   char                 *ignore_guids_file_name = NULL;
   uint32_t              val;
-  const char * const    short_option = "i:f:ed:g:l:s:t:a:P:NuvVhorcyx";
+  const char * const    short_option = "i:f:ed:g:l:s:t:a:P:NQuvVhorcyx";
 
   /*
     In the array below, the 2nd parameter specified the number
@@ -546,6 +549,7 @@ #endif
       {  "erase_log_file",0, NULL, 'e'},
       {  "Pconfig",       1, NULL, 'P'},
       {  "no_part_enforce",0,NULL, 'N'},
+      {  "no_qos",        0, NULL, 'Q'},
       {  "maxsmps",       1, NULL, 'n'},
       {  "console",       0, NULL, 'q'},
       {  "V",             0, NULL, 'V'},
@@ -738,6 +742,10 @@ #endif
       opt.no_partition_enforcement = TRUE;
       break;
 
+    case 'Q':
+      opt.no_qos = TRUE;
+      break;
+
     case 'y':
       opt.exit_on_fatal = FALSE;
       printf(" Staying on fatal initialization errors\n");
diff --git a/osm/opensm/osm_qos.c b/osm/opensm/osm_qos.c
index be27b40..20cfaad 100644
--- a/osm/opensm/osm_qos.c
+++ b/osm/opensm/osm_qos.c
@@ -318,6 +318,9 @@ osm_signal_t osm_qos_setup(osm_opensm_t 
 	ib_api_status_t status;
 	uint32_t i;
 
+	if (p_osm->subn.opt.no_qos)
+		return OSM_SIGNAL_DONE;
+
 	OSM_LOG_ENTER(&p_osm->log, osm_qos_setup);
 
 	qos_build_config(&hca_config, &p_osm->subn.opt.qos_hca_options,
diff --git a/osm/opensm/osm_subnet.c b/osm/opensm/osm_subnet.c
index 4580ed1..036a6ba 100644
--- a/osm/opensm/osm_subnet.c
+++ b/osm/opensm/osm_subnet.c
@@ -456,6 +456,7 @@ osm_subn_set_default_opt(
   p_opt->log_file = OSM_DEFAULT_LOG_FILE;
   p_opt->partition_config_file = OSM_DEFAULT_PARTITION_CONFIG_FILE;
   p_opt->no_partition_enforcement = FALSE;
+  p_opt->no_qos = FALSE;
   p_opt->accum_log_file = TRUE;
   p_opt->port_profile_switch_nodes = FALSE;
   p_opt->max_port_profile = 0xffffffff;
@@ -889,6 +890,10 @@ osm_subn_parse_conf_file(
         p_key, p_val, &p_opts->no_partition_enforcement);
 
       __osm_subn_opts_unpack_boolean(
+        "no_qos",
+        p_key, p_val, &p_opts->no_qos);
+
+      __osm_subn_opts_unpack_boolean(
         "accum_log_file",
         p_key, p_val, &p_opts->accum_log_file);
 
@@ -1117,7 +1122,11 @@ osm_subn_write_conf_file(
   
   fprintf(
     opts_file,
-    "#\n# QoS OPTIONS\n#\n\n");
+    "#\n# QoS OPTIONS\n#\n"
+    "# Disable QoS setup\n"
+    "no_qos %s\n\n",
+    p_opts->no_qos ? "TRUE" : "FALSE");
+
   subn_dump_qos_options(opts_file,
     "QoS default options", "qos", &p_opts->qos_options);
   fprintf(opts_file, "\n");



More information about the general mailing list