[ofa-general] [PATCH] osm: QoS - fixing ServiceID and PKey bug in match rules

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Tue Sep 4 05:49:36 PDT 2007


Hi Sasha.

Small patch that fixes ServiceID and PKey bug in QoS policy match rules.

Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 opensm/include/iba/ib_types.h  |    3 ++-
 opensm/opensm/osm_qos_policy.c |    7 ++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/opensm/include/iba/ib_types.h b/opensm/include/iba/ib_types.h
index 4ab4145..0a096f9 100644
--- a/opensm/include/iba/ib_types.h
+++ b/opensm/include/iba/ib_types.h
@@ -2379,7 +2379,8 @@ typedef struct _ib_path_rec {
 *********/

 /* Path Record Component Masks */
-#define  IB_PR_COMPMASK_SERVICEID         (CL_HTON64(((uint64_t)1)<<1))
+#define  IB_PR_COMPMASK_SERVICEID_MSB     (CL_HTON64(((uint64_t)1)<<0))
+#define  IB_PR_COMPMASK_SERVICEID_LSB     (CL_HTON64(((uint64_t)1)<<1))
 #define  IB_PR_COMPMASK_DGID              (CL_HTON64(((uint64_t)1)<<2))
 #define  IB_PR_COMPMASK_SGID              (CL_HTON64(((uint64_t)1)<<3))
 #define  IB_PR_COMPMASK_DLID              (CL_HTON64(((uint64_t)1)<<4))
diff --git a/opensm/opensm/osm_qos_policy.c b/opensm/opensm/osm_qos_policy.c
index a5a8856..059a861 100644
--- a/opensm/opensm/osm_qos_policy.c
+++ b/opensm/opensm/osm_qos_policy.c
@@ -640,7 +640,8 @@ static osm_qos_match_rule_t *__qos_policy_get_match_rule_by_pr(
 		   to have a matching Service ID to match the rule */

 		if (p_qos_match_rule->service_id_range_len) {
-			if (!(comp_mask & IB_PR_COMPMASK_SERVICEID)) {
+			if (!(comp_mask & IB_PR_COMPMASK_SERVICEID_MSB) ||
+			    !(comp_mask & IB_PR_COMPMASK_SERVICEID_LSB)) {
 				list_iterator = cl_list_next(list_iterator);
 				continue;
 			}
@@ -648,7 +649,7 @@ static osm_qos_match_rule_t *__qos_policy_get_match_rule_by_pr(
 			if (!__is_num_in_range_arr
 			    (p_qos_match_rule->service_id_range_arr,
 			     p_qos_match_rule->service_id_range_len,
-			     p_pr->service_id)) {
+			     cl_ntoh64(p_pr->service_id))) {
 				list_iterator = cl_list_next(list_iterator);
 				continue;
 			}
@@ -667,7 +668,7 @@ static osm_qos_match_rule_t *__qos_policy_get_match_rule_by_pr(
 			if (!__is_num_in_range_arr
 			    (p_qos_match_rule->pkey_range_arr,
 			     p_qos_match_rule->pkey_range_len,
-			     ib_path_rec_qos_class(p_pr))) {
+			     cl_ntoh16(p_pr->pkey))) {
 				list_iterator = cl_list_next(list_iterator);
 				continue;
 			}
-- 
1.5.1.4




More information about the general mailing list