From patchwork Wed Jan 13 14:54:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sebastien dugue X-Patchwork-Id: 72651 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0DEwLZw028180 for ; Wed, 13 Jan 2010 14:58:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755565Ab0AMO6W (ORCPT ); Wed, 13 Jan 2010 09:58:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755342Ab0AMO6W (ORCPT ); Wed, 13 Jan 2010 09:58:22 -0500 Received: from ecfrec.frec.bull.fr ([129.183.4.8]:40639 "EHLO ecfrec.frec.bull.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755565Ab0AMO6T (ORCPT ); Wed, 13 Jan 2010 09:58:19 -0500 Received: from cyclope.frec.bull.fr (cyclope.frec.bull.fr [129.183.4.9]) by ecfrec.frec.bull.fr (Postfix) with ESMTP id EA14C701AC; Wed, 13 Jan 2010 15:58:10 +0100 (CET) Received: from frecb007965 (frecb007965.frec.bull.fr [129.183.101.36]) by cyclope.frec.bull.fr (Postfix) with ESMTP id BCFE727291; Wed, 13 Jan 2010 15:58:08 +0100 (CET) Date: Wed, 13 Jan 2010 15:54:42 +0100 From: sebastien dugue To: linux-rdma Cc: Roland Dreier , Sasha Khapyorsky Subject: [PATCH 2/3] opensm/qos_policy: Add a new service ID and keyword for Lustre QoS Message-ID: <20100113155442.28930e5c@frecb007965> In-Reply-To: <20100113154952.0f01aa1d@frecb007965> References: <20100113154952.0f01aa1d@frecb007965> Organization: BULL X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.12; i486-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/opensm/include/opensm/osm_qos_policy.h b/opensm/include/opensm/osm_qos_policy.h index 03ee891..ea3998a 100644 --- a/opensm/include/opensm/osm_qos_policy.h +++ b/opensm/include/opensm/osm_qos_policy.h @@ -54,11 +54,12 @@ #define OSM_QOS_POLICY_MAX_PORTS_ON_SWITCH 128 #define OSM_QOS_POLICY_DEFAULT_LEVEL_NAME "default" -#define OSM_QOS_POLICY_ULP_SDP_SERVICE_ID 0x0000000000010000ULL -#define OSM_QOS_POLICY_ULP_RDS_SERVICE_ID 0x0000000001060000ULL -#define OSM_QOS_POLICY_ULP_RDS_PORT 0x48CA -#define OSM_QOS_POLICY_ULP_ISER_SERVICE_ID 0x0000000001060000ULL -#define OSM_QOS_POLICY_ULP_ISER_PORT 0x0CBC +#define OSM_QOS_POLICY_ULP_SDP_SERVICE_ID 0x0000000000010000ULL +#define OSM_QOS_POLICY_ULP_RDS_SERVICE_ID 0x0000000001060000ULL +#define OSM_QOS_POLICY_ULP_RDS_PORT 0x48CA +#define OSM_QOS_POLICY_ULP_ISER_SERVICE_ID 0x0000000001060000ULL +#define OSM_QOS_POLICY_ULP_ISER_PORT 0x0CBC +#define OSM_QOS_POLICY_ULP_LUSTRE_SERVICE_ID 0x0000000001530000ULL #define OSM_QOS_POLICY_NODE_TYPE_CA (((uint8_t)1)<pkey_range_len = range_len; } qos_ulp_sl + + | qos_ulp_type_lustre_default { + /* "lustre : sl" - default SL for Lustre */ + uint64_t ** range_arr = + (uint64_t **)malloc(sizeof(uint64_t *)); + range_arr[0] = (uint64_t *)malloc(2*sizeof(uint64_t)); + range_arr[0][0] = OSM_QOS_POLICY_ULP_LUSTRE_SERVICE_ID; + range_arr[0][1] = OSM_QOS_POLICY_ULP_LUSTRE_SERVICE_ID + 0xFFFF; + + p_current_qos_match_rule->service_id_range_arr = range_arr; + p_current_qos_match_rule->service_id_range_len = 1; + + } qos_ulp_sl + + | qos_ulp_type_lustre_port list_of_ranges TK_DOTDOT { + /* Lustre with port numbers */ + uint64_t ** range_arr; + unsigned range_len; + unsigned i; + + if (!cl_list_count(&tmp_parser_struct.num_pair_list)) + { + yyerror("Lustre ULP rule doesn't have port numbers"); + return 1; + } + + /* get all the port ranges */ + __rangelist2rangearr( &tmp_parser_struct.num_pair_list, + &range_arr, + &range_len ); + /* now translate these port numbers into service ids */ + for (i = 0; i < range_len; i++) + { + if (range_arr[i][0] > 0xFFFF || range_arr[i][1] > 0xFFFF) + { + yyerror("Lustre port number out of range"); + return 1; + } + range_arr[i][0] += OSM_QOS_POLICY_ULP_LUSTRE_SERVICE_ID; + range_arr[i][1] += OSM_QOS_POLICY_ULP_LUSTRE_SERVICE_ID; + } + + p_current_qos_match_rule->service_id_range_arr = range_arr; + p_current_qos_match_rule->service_id_range_len = range_len; + + } qos_ulp_sl + + | qos_ulp_type_lustre_port_guid list_of_ranges TK_DOTDOT { + /* lustre, port-guid ... : sl */ + uint64_t ** range_arr; + unsigned range_len; + + if (!cl_list_count(&tmp_parser_struct.num_pair_list)) + { + yyerror("Lustre ULP rule doesn't have port guids"); + return 1; + } + + /* create a new port group with these ports */ + __parser_port_group_start(); + + p_current_port_group->name = strdup("_Lustre_Targets_"); + p_current_port_group->use = strdup("Generated from ULP rules"); + + __rangelist2rangearr( &tmp_parser_struct.num_pair_list, + &range_arr, + &range_len ); + + __parser_add_guid_range_to_port_map( + &p_current_port_group->port_map, + range_arr, + range_len); + + /* add this port group to the destination + groups of the current match rule */ + cl_list_insert_tail(&p_current_qos_match_rule->destination_group_list, + p_current_port_group); + + __parser_port_group_end(); + + /* setup ranges as in qos_ulp_type_lustre_default */ + range_arr = (uint64_t **)malloc(sizeof(uint64_t *)); + range_arr[0] = (uint64_t *)malloc(2*sizeof(uint64_t)); + range_arr[0][0] = OSM_QOS_POLICY_ULP_LUSTRE_SERVICE_ID; + range_arr[0][1] = OSM_QOS_POLICY_ULP_LUSTRE_SERVICE_ID + 0xFFFF; + + p_current_qos_match_rule->service_id_range_arr = range_arr; + p_current_qos_match_rule->service_id_range_len = 1; + + } qos_ulp_sl ; qos_ulp_type_any_service: TK_ULP_ANY_SERVICE_ID @@ -989,6 +1088,15 @@ qos_ulp_type_ipoib_default: TK_ULP_IPOIB_DEFAULT qos_ulp_type_ipoib_pkey: TK_ULP_IPOIB_PKEY { __parser_ulp_match_rule_start(); }; +qos_ulp_type_lustre_default: TK_ULP_LUSTRE_DEFAULT + { __parser_ulp_match_rule_start(); }; + +qos_ulp_type_lustre_port: TK_ULP_LUSTRE_PORT + { __parser_ulp_match_rule_start(); }; + +qos_ulp_type_lustre_port_guid: TK_ULP_LUSTRE_PORT_GUID + { __parser_ulp_match_rule_start(); }; + qos_ulp_sl: single_number { /* get the SL for ULP rules */