[openib-general] [PATCH 4/10] osm: QoS in OpenSM

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Tue Jan 30 07:31:27 PST 2007


QoS policy file parser header file

Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 osm/include/opensm/osm_qos_parser.h |  218 +++++++++++++++++++++++++++++++++++
 1 files changed, 218 insertions(+), 0 deletions(-)

diff --git a/osm/include/opensm/osm_qos_parser.h b/osm/include/opensm/osm_qos_parser.h
new file mode 100644
index 0000000..4f0e598
--- /dev/null
+++ b/osm/include/opensm/osm_qos_parser.h
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
+ * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+/*
+ * Abstract:
+ *    Declaration of OSM QoS parser.
+ *
+ * Environment:
+ *    Linux User Mode
+ *
+ * Author:
+ *    Yevgeny Kliteynik, Mellanox
+ */
+
+#ifndef OSM_QOS_PARSER_H
+#define OSM_QOS_PARSER_H
+
+#include <stdio.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <iba/ib_types.h>
+#include <opensm/osm_log.h>
+#include <opensm/osm_opensm.h>
+
+#define YYSTYPE char *
+
+#define OSM_QOS_NODE_TYPE_CA     "CA"
+#define OSM_QOS_NODE_TYPE_SWITCH "SWITCH"
+#define OSM_QOS_NODE_TYPE_ROUTER "ROUTER"
+
+typedef enum {UNDEF, ROUTER, CA, SWITCH} node_type_t;
+
+/***************************************************/
+
+typedef struct osm_qos_string_vector_item_t_ {
+   cl_map_item_t   map_item;
+   char          * str;
+} osm_qos_string_vector_item_t;
+
+typedef struct osm_qos_uint64_vector_item_t_ {
+   cl_map_item_t   map_item;
+   uint64_t        value;
+} osm_qos_uint64_vector_item_t;
+
+typedef struct osm_qos_uint32_vector_item_t_ {
+   cl_map_item_t   map_item;
+   uint32_t        value;
+} osm_qos_uint32_vector_item_t;
+
+typedef struct osm_qos_uint16_vector_item_t_ {
+   cl_map_item_t   map_item;
+   uint16_t        value;
+} osm_qos_uint16_vector_item_t;
+
+typedef struct osm_qos_uint8_vector_item_t_ {
+   cl_map_item_t   map_item;
+   uint8_t         value;
+} osm_qos_uint8_vector_item_t;
+
+typedef struct osm_qos_vlarb_hl_vector_item_t_ {
+   cl_map_item_t   map_item;
+   uint32_t        sl;
+   uint32_t        credits;
+} osm_qos_vlarb_hl_vector_item_t;
+
+/***************************************************/
+
+typedef struct osm_qos_port_group_t_ {
+   cl_map_item_t    map_item;
+   char           * name;
+   char           * use;
+   cl_ptr_vector_t  port_guids; /* vector of uint64_t */
+   cl_ptr_vector_t  port_names; /* vector of string   */
+   cl_ptr_vector_t  partitions; /* vector of string   */
+   cl_ptr_vector_t  node_types; /* vector of uint8_t  */
+} osm_qos_port_group_t;
+
+/***************************************************/
+
+typedef struct osm_qos_sl2vl_scope_t_ {
+   cl_map_item_t    map_item;
+   cl_ptr_vector_t  groups;      /* vector of string */
+   cl_ptr_vector_t  from;        /* vector of string */
+   cl_ptr_vector_t  to;          /* vector of string */
+   cl_ptr_vector_t  across_from; /* vector of string */
+   cl_ptr_vector_t  across_to;   /* vector of string */
+   uint8_t          sl2vl_table[16];
+} osm_qos_sl2vl_scope_t;
+
+/***************************************************/
+
+typedef struct osm_qos_vlarb_scope_t_ {
+   cl_map_item_t    map_item;
+   cl_ptr_vector_t  groups;       /* vector of string */
+   cl_ptr_vector_t  across;       /* vector of string */
+   cl_ptr_vector_t  vlarb_highs;  /* vector of string */
+   cl_ptr_vector_t  vlarb_lows;   /* vector of string */
+   uint32_t         vl_high_limit;
+} osm_qos_vlarb_scope_t;
+
+/***************************************************/
+
+typedef struct osm_qos_level_t_ {
+   cl_map_item_t    map_item;
+   char           * use;
+   uint32_t         sn;
+   boolean_t        sn_set;
+   uint32_t         sl;
+   boolean_t        sl_set;
+   uint8_t          mtu_limit;
+   boolean_t        mtu_limit_set;
+   uint8_t          rate_limit;
+   boolean_t        rate_limit_set;
+   uint8_t          pkt_life;
+   boolean_t        pkt_life_set;
+   uint16_t         pkey;
+   boolean_t        pkey_set;
+   uint16_t         class;
+   boolean_t        class_set;
+} osm_qos_level_t;
+
+/***************************************************/
+
+typedef struct osm_qos_match_rule_t_ {
+   cl_map_item_t     map_item;
+   char            * use;
+   char            * source;
+   char            * destination;
+   cl_ptr_vector_t   services;      /* vector of uint64 */
+   cl_ptr_vector_t   classes;       /* vector of uint32 */
+   uint32_t          qos_level_sn;
+} osm_qos_match_rule_t;
+
+/***************************************************/
+
+typedef struct osm_qos_parse_tree_t_ {
+   cl_map_item_t     map_item;
+   cl_ptr_vector_t   port_groups;      /* vector of osm_qos_port_group_t */
+   cl_ptr_vector_t   sl2vl_tables;     /* vector of osm_qos_sl2vl_scope_t */
+   cl_ptr_vector_t   vlarb_tables;     /* vector of osm_qos_vlarb_scope_t */
+   cl_ptr_vector_t   qos_levels;       /* vector of osm_qos_level_t */
+   cl_ptr_vector_t   qos_match_rules;  /* vector of osm_qos_match_rule_t */
+} osm_qos_parse_tree_t;
+
+/***************************************************/
+
+int osm_qos_parse_policy_file(
+   IN  osm_log_t             * p_log,
+   IN  const char            * policy_file);
+
+void osm_qos_parser_destroy_parse_tree(
+    IN  osm_qos_parse_tree_t * p_qos_parse_tree);
+
+void osm_qos_parser_get_port_group_by_name(
+    IN  osm_qos_parse_tree_t  * p_qos_parse_tree,
+    IN  const char *            group_name,
+    OUT osm_qos_port_group_t ** pp_port_group);
+
+void osm_qos_parser_get_qos_level_by_sn(
+    IN  osm_qos_parse_tree_t  * p_qos_parse_tree,
+    IN  uint32_t                sn,
+    OUT osm_qos_level_t      ** pp_qos_level);
+
+boolean_t osm_qos_parser_is_port_in_group(
+   IN  const osm_pr_rcv_t    * const p_rcv,
+   IN  osm_physp_t           * p_physp,
+   IN  osm_qos_port_group_t  * p_port_group);
+
+void osm_qos_parser_get_qos_level_by_pr(
+   IN  const osm_pr_rcv_t  * const p_rcv,
+   IN  const ib_path_rec_t * const p_pr,
+   IN  const osm_port_t*     const p_src_port,
+   IN  const osm_port_t*     const p_dest_port,
+   IN  const uint16_t        dest_lid_ho,
+   IN  const ib_net64_t      comp_mask,
+   OUT osm_qos_level_t    ** pp_qos_level);
+
+/***************************************************/
+
+extern osm_qos_parse_tree_t * p_qos_parse_tree;
+
+/***************************************************/
+
+#endif /* ifndef OSM_QOS_PARSER_H */
-- 
1.4.4.1.GIT






More information about the general mailing list