[ofa-general] [PATCH] opensm/QoS: fixing RDS handling in QoS policy

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Sun Jan 27 01:46:05 PST 2008


Sasha,

Please apply the following patch to ofed_1_3 and master.

Unlike SDP, RDS opens an RC pair of QPs per pair of IPs, so it
has a predefined port number that in included in the service id.
Removing all the code that was handling per-port service id for
RDS and replacing it with the right port number.

Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 opensm/include/opensm/osm_qos_policy.h |    1 +
 opensm/opensm/osm_qos_parser.l         |    2 -
 opensm/opensm/osm_qos_parser.y         |   47 +++-----------------------------
 3 files changed, 5 insertions(+), 45 deletions(-)

diff --git a/opensm/include/opensm/osm_qos_policy.h b/opensm/include/opensm/osm_qos_policy.h
index 82b6258..f5815d8 100644
--- a/opensm/include/opensm/osm_qos_policy.h
+++ b/opensm/include/opensm/osm_qos_policy.h
@@ -59,6 +59,7 @@

 #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        0x035C

diff --git a/opensm/opensm/osm_qos_parser.l b/opensm/opensm/osm_qos_parser.l
index 41f8720..de59621 100644
--- a/opensm/opensm/osm_qos_parser.l
+++ b/opensm/opensm/osm_qos_parser.l
@@ -110,7 +110,6 @@ static void reset_new_line_flags();
 #define START_ULP_SDP_DEFAULT   {in_single_number = TRUE;}      /* single number */
 #define START_ULP_SDP_PORT      {in_list_of_num_ranges = TRUE;} /* comma-separated list of hex or dec num ranges */
 #define START_ULP_RDS_DEFAULT   {in_single_number = TRUE;}      /* single number */
-#define START_ULP_RDS_PORT      {in_list_of_num_ranges = TRUE;} /* comma-separated list of hex or dec num ranges */
 #define START_ULP_ISER_DEFAULT  {in_single_number = TRUE;}      /* single number */
 #define START_ULP_ISER_PORT     {in_list_of_num_ranges = TRUE;} /* comma-separated list of hex or dec num ranges */
 #define START_ULP_SRP_GUID      {in_list_of_num_ranges = TRUE;} /* comma-separated list of hex or dec num ranges */
@@ -278,7 +277,6 @@ QUOTED_TEXT             \"[^\"]*\"
 {ULP_SDP}{WHITE_COMMA_WHITE}{PORT_NUM}         { SAVE_POS; HANDLE_IF_IN_DESCRIPTION; START_ULP_SDP_PORT; return TK_ULP_SDP_PORT; }

 {ULP_RDS}{WHITE_DOTDOT_WHITE}                  { SAVE_POS; HANDLE_IF_IN_DESCRIPTION; START_ULP_RDS_DEFAULT; return TK_ULP_RDS_DEFAULT; }
-{ULP_RDS}{WHITE_COMMA_WHITE}{PORT_NUM}         { SAVE_POS; HANDLE_IF_IN_DESCRIPTION; START_ULP_RDS_PORT; return TK_ULP_RDS_PORT; }

 {ULP_ISER}{WHITE_DOTDOT_WHITE}                 { SAVE_POS; HANDLE_IF_IN_DESCRIPTION; START_ULP_SDP_DEFAULT; return TK_ULP_ISER_DEFAULT; }
 {ULP_ISER}{WHITE_COMMA_WHITE}{PORT_NUM}        { SAVE_POS; HANDLE_IF_IN_DESCRIPTION; START_ULP_SDP_PORT; return TK_ULP_ISER_PORT; }
diff --git a/opensm/opensm/osm_qos_parser.y b/opensm/opensm/osm_qos_parser.y
index 8cae5f3..b1eecc0 100644
--- a/opensm/opensm/osm_qos_parser.y
+++ b/opensm/opensm/osm_qos_parser.y
@@ -261,7 +261,6 @@ static cl_list_t __ulp_match_rules;
 %token TK_ULP_SDP_DEFAULT
 %token TK_ULP_SDP_PORT
 %token TK_ULP_RDS_DEFAULT
-%token TK_ULP_RDS_PORT
 %token TK_ULP_ISER_DEFAULT
 %token TK_ULP_ISER_PORT
 %token TK_ULP_SRP_GUID
@@ -295,8 +294,7 @@ qos_policy_entry:     qos_ulps_section
      *      sdp, port-num 10000-20000     : 2
      *      sdp                           : 0 #default SL for SDP
      *      srp, target-port-guid 0x1234  : 2
-     *      rds, port-num 25000           : 2 #SL for RDS when destination port is 25000
-     *      rds,                          : 0 #default SL for RDS
+     *      rds                           : 0 #SL for RDS
      *      iser, port-num 900            : 5 #SL for iSER where target port is 900
      *      iser                          : 4 #default SL for iSER
      *      ipoib, pkey 0x0001            : 5 #SL for IPoIB on partition with pkey 0x0001
@@ -620,7 +618,6 @@ qos_match_rule_entry: qos_match_rule_use
      *   sdp
      *   sdp with port-num
      *   rds
-     *   rds with port-num
      *   srp with port-guid
      *   iser
      *   iser with port-num
@@ -773,51 +770,18 @@ qos_ulp:            TK_ULP_DEFAULT single_number {
                     } qos_ulp_sl

                     | qos_ulp_type_rds_default {
-                        /* "rds : sl" - default SL for RDS */
+                        /* "rds : sl" - SL for RDS */
                         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_RDS_SERVICE_ID;
-                        range_arr[0][1] = OSM_QOS_POLICY_ULP_RDS_SERVICE_ID + 0xFFFF;
+                        range_arr[0][0] = range_arr[0][1] =
+                           OSM_QOS_POLICY_ULP_RDS_SERVICE_ID + OSM_QOS_POLICY_ULP_RDS_PORT;

                         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_rds_port list_of_ranges TK_DOTDOT {
-                        /* rds with port numbers */
-                        uint64_t ** range_arr;
-                        unsigned    range_len;
-                        unsigned    i;
-
-                        if (!cl_list_count(&tmp_parser_struct.num_pair_list))
-                        {
-                            __qos_parser_error("RDS 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)
-                            {
-                                __qos_parser_error("SDP port number out of range");
-                                return 1;
-                            }
-                            range_arr[i][0] += OSM_QOS_POLICY_ULP_RDS_SERVICE_ID;
-                            range_arr[i][1] += OSM_QOS_POLICY_ULP_RDS_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_iser_default {
                         /* "iSER : sl" - default SL for iSER */
                         uint64_t ** range_arr =
@@ -969,9 +933,6 @@ qos_ulp_type_sdp_port: TK_ULP_SDP_PORT
 qos_ulp_type_rds_default: TK_ULP_RDS_DEFAULT
                     { __parser_ulp_match_rule_start(); };

-qos_ulp_type_rds_port: TK_ULP_RDS_PORT
-                    { __parser_ulp_match_rule_start(); };
-
 qos_ulp_type_iser_default: TK_ULP_ISER_DEFAULT
                     { __parser_ulp_match_rule_start(); };

-- 
1.5.1.4




More information about the general mailing list