[ofa-general] [PATCH 7/7] osm: QoS - reading policy file

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Mon Aug 20 05:11:21 PDT 2007


Reading QoS policy file

Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 opensm/opensm/osm_qos.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/opensm/opensm/osm_qos.c b/opensm/opensm/osm_qos.c
index dff9996..d512f53 100644
--- a/opensm/opensm/osm_qos.c
+++ b/opensm/opensm/osm_qos.c
@@ -52,6 +52,8 @@
 #include <complib/cl_debug.h>
 #include <opensm/osm_opensm.h>
 #include <opensm/osm_subnet.h>
+#include <opensm/osm_qos_policy.h>
+#include <sys/stat.h>
 
 struct qos_config {
 	uint8_t max_vls;
@@ -279,12 +281,38 @@ osm_signal_t osm_qos_setup(osm_opensm_t * p_osm)
 	ib_api_status_t status;
 	unsigned force_update;
 	uint8_t i;
+	struct stat statbuf;
 
 	if (p_osm->subn.opt.no_qos)
 		return OSM_SIGNAL_DONE;
 
 	OSM_LOG_ENTER(&p_osm->log, osm_qos_setup);
 
+	/* read QoS policy config file */
+	if ( !stat(p_osm->subn.opt.qos_policy_file, &statbuf) )
+	{
+		static boolean_t first_time = TRUE;
+		if ( first_time )
+		{
+			osm_log(&p_osm->log, OSM_LOG_INFO,
+					"osm_qos_setup: Loading QoS policy file %s\n",
+					p_osm->subn.opt.qos_policy_file);
+			first_time = FALSE;
+		}
+		if ( !osm_qos_parse_policy_file(&p_osm->log, p_osm->subn.opt.qos_policy_file) )
+			osm_log(&p_osm->log, OSM_LOG_VERBOSE,
+					"osm_qos_setup: QoS policy file %s parsed successfully\n",
+					p_osm->subn.opt.qos_policy_file);
+		else
+			osm_log(&p_osm->log, OSM_LOG_ERROR,
+					"osm_qos_setup: ERR 6204: Failed parsing QoS policy file %s\n",
+					p_osm->subn.opt.qos_policy_file);
+	}
+
+	/*
+	 * ToDo: Setup QoS on the fabric according to QoS policy
+	 */
+
 	qos_build_config(&ca_config, &p_osm->subn.opt.qos_ca_options,
 			 &p_osm->subn.opt.qos_options);
 	qos_build_config(&sw0_config, &p_osm->subn.opt.qos_sw0_options,
-- 
1.5.1.4




More information about the general mailing list