[ofa-general] [PATCH v2] opensm/osm_qos_policy.c: log matched QoS criteria

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Thu May 1 07:11:08 PDT 2008


Adding log messages for matched criteria of
the QoS policy rule.

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

diff --git a/opensm/opensm/osm_qos_policy.c b/opensm/opensm/osm_qos_policy.c
index 6c81872..ebe3a7f 100644
--- a/opensm/opensm/osm_qos_policy.c
+++ b/opensm/opensm/osm_qos_policy.c
@@ -598,10 +598,13 @@ static osm_qos_match_rule_t *__qos_policy_get_match_rule_by_params(
 {
 	osm_qos_match_rule_t *p_qos_match_rule = NULL;
 	cl_list_iterator_t list_iterator;
+	osm_log_t * p_log = &p_qos_policy->p_subn->p_osm->log;

 	if (!cl_list_count(&p_qos_policy->qos_match_rules))
 		return NULL;

+	OSM_LOG_ENTER(p_log);
+
 	/* Go over all QoS match rules and find the one that matches the request */

 	list_iterator = cl_list_head(&p_qos_policy->qos_match_rules);
@@ -624,6 +627,8 @@ static osm_qos_match_rule_t *__qos_policy_get_match_rule_by_params(
 				list_iterator = cl_list_next(list_iterator);
 				continue;
 			}
+			OSM_LOG(&p_qos_policy->p_subn->p_osm->log, OSM_LOG_DEBUG,
+				"Source port matched.\n");
 		}

 		/* If a match rule has Destination groups, PR request dest. has to be in this list */
@@ -637,6 +642,8 @@ static osm_qos_match_rule_t *__qos_policy_get_match_rule_by_params(
 				list_iterator = cl_list_next(list_iterator);
 				continue;
 			}
+			OSM_LOG(&p_qos_policy->p_subn->p_osm->log, OSM_LOG_DEBUG,
+				"Destination port matched.\n");
 		}

 		/* If a match rule has QoS classes, PR request HAS
@@ -655,7 +662,8 @@ static osm_qos_match_rule_t *__qos_policy_get_match_rule_by_params(
 				list_iterator = cl_list_next(list_iterator);
 				continue;
 			}
-
+			OSM_LOG(&p_qos_policy->p_subn->p_osm->log, OSM_LOG_DEBUG,
+				"QoS Class matched.\n");
 		}

 		/* If a match rule has Service IDs, PR request HAS
@@ -675,7 +683,8 @@ static osm_qos_match_rule_t *__qos_policy_get_match_rule_by_params(
 				list_iterator = cl_list_next(list_iterator);
 				continue;
 			}
-
+			OSM_LOG(&p_qos_policy->p_subn->p_osm->log, OSM_LOG_DEBUG,
+				"Service ID matched.\n");
 		}

 		/* If a match rule has PKeys, PR request HAS
@@ -694,13 +703,16 @@ static osm_qos_match_rule_t *__qos_policy_get_match_rule_by_params(
 				list_iterator = cl_list_next(list_iterator);
 				continue;
 			}
-
+			OSM_LOG(&p_qos_policy->p_subn->p_osm->log, OSM_LOG_DEBUG,
+				"PKey matched.\n");
 		}

 		/* if we got here, then this match-rule matched this PR request */
 		break;
 	}

+	OSM_LOG_EXIT(p_log);
+
 	if (list_iterator == cl_list_end(&p_qos_policy->qos_match_rules))
 		return NULL;

-- 
1.5.1.4





More information about the general mailing list