DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] flow_classify: fix logging
@ 2017-10-26 10:47 Bernard Iremonger
  2017-10-26 12:20 ` Singh, Jasvinder
  0 siblings, 1 reply; 3+ messages in thread
From: Bernard Iremonger @ 2017-10-26 10:47 UTC (permalink / raw)
  To: dev, jasvinder.singh; +Cc: Bernard Iremonger

Set log_level to RTE_LOG_INFO.
The RTE_LIBRTE_CLASSIFY_DEBUG macro has been removed from the
config file, use the log_level instead.

Fixes: be41ac2a330f ("flow_classify: introduce flow classify library")
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 lib/librte_flow_classify/rte_flow_classify.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/lib/librte_flow_classify/rte_flow_classify.c b/lib/librte_flow_classify/rte_flow_classify.c
index f4a95d4..e6f4486 100644
--- a/lib/librte_flow_classify/rte_flow_classify.c
+++ b/lib/librte_flow_classify/rte_flow_classify.c
@@ -155,7 +155,7 @@ struct rte_flow_classify_rule {
 	return ret;
 }
 
-#ifdef RTE_LIBRTE_CLASSIFY_DEBUG
+
 #define uint32_t_to_char(ip, a, b, c, d) do {\
 		*a = (unsigned char)(ip >> 24 & 0xff);\
 		*b = (unsigned char)(ip >> 16 & 0xff);\
@@ -216,7 +216,6 @@ struct rte_flow_classify_rule {
 		key->field_value[DSTP_FIELD_IPV4].value.u16,
 		key->field_value[DSTP_FIELD_IPV4].mask_range.u16);
 }
-#endif
 
 static int
 rte_flow_classifier_check_params(struct rte_flow_classifier_params *params)
@@ -418,6 +417,7 @@ struct rte_flow_classifier *
 allocate_acl_ipv4_5tuple_rule(void)
 {
 	struct rte_flow_classify_rule *rule;
+	int log_level;
 
 	rule = malloc(sizeof(struct rte_flow_classify_rule));
 	if (!rule)
@@ -467,18 +467,19 @@ struct rte_flow_classifier *
 	rule->rules.u.ipv4_5tuple.dst_port_mask = ntuple_filter.dst_port_mask;
 	rule->rules.u.ipv4_5tuple.dst_port = ntuple_filter.dst_port;
 
-#ifdef RTE_LIBRTE_CLASSIFY_DEBUG
-	print_acl_ipv4_key_add(&rule->u.key.key_add);
-#endif
+	log_level = rte_log_get_level(librte_flow_classify_logtype);
+
+	if (log_level == RTE_LOG_DEBUG)
+		print_acl_ipv4_key_add(&rule->u.key.key_add);
 
 	/* key delete values */
 	memcpy(&rule->u.key.key_del.field_value[PROTO_FIELD_IPV4],
 	       &rule->u.key.key_add.field_value[PROTO_FIELD_IPV4],
 	       NUM_FIELDS_IPV4 * sizeof(struct rte_acl_field));
 
-#ifdef RTE_LIBRTE_CLASSIFY_DEBUG
-	print_acl_ipv4_key_delete(&rule->u.key.key_del);
-#endif
+	if (log_level == RTE_LOG_DEBUG)
+		print_acl_ipv4_key_delete(&rule->u.key.key_del);
+
 	return rule;
 }
 
@@ -686,5 +687,5 @@ struct rte_flow_classify_rule *
 	librte_flow_classify_logtype =
 		rte_log_register("librte.flow_classify");
 	if (librte_flow_classify_logtype >= 0)
-		rte_log_set_level(librte_flow_classify_logtype, RTE_LOG_DEBUG);
+		rte_log_set_level(librte_flow_classify_logtype, RTE_LOG_INFO);
 }
-- 
1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] flow_classify: fix logging
  2017-10-26 10:47 [dpdk-dev] [PATCH] flow_classify: fix logging Bernard Iremonger
@ 2017-10-26 12:20 ` Singh, Jasvinder
  2017-10-26 22:13   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Singh, Jasvinder @ 2017-10-26 12:20 UTC (permalink / raw)
  To: Iremonger, Bernard, dev



> -----Original Message-----
> From: Iremonger, Bernard
> Sent: Thursday, October 26, 2017 11:48 AM
> To: dev@dpdk.org; Singh, Jasvinder <jasvinder.singh@intel.com>
> Cc: Iremonger, Bernard <bernard.iremonger@intel.com>
> Subject: [PATCH] flow_classify: fix logging
> 
> Set log_level to RTE_LOG_INFO.
> The RTE_LIBRTE_CLASSIFY_DEBUG macro has been removed from the config
> file, use the log_level instead.
> 
> Fixes: be41ac2a330f ("flow_classify: introduce flow classify library")
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---

Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] flow_classify: fix logging
  2017-10-26 12:20 ` Singh, Jasvinder
@ 2017-10-26 22:13   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2017-10-26 22:13 UTC (permalink / raw)
  To: Iremonger, Bernard; +Cc: dev, Singh, Jasvinder

> > Set log_level to RTE_LOG_INFO.
> > The RTE_LIBRTE_CLASSIFY_DEBUG macro has been removed from the config
> > file, use the log_level instead.
> > 
> > Fixes: be41ac2a330f ("flow_classify: introduce flow classify library")
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> 
> Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-26 22:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-26 10:47 [dpdk-dev] [PATCH] flow_classify: fix logging Bernard Iremonger
2017-10-26 12:20 ` Singh, Jasvinder
2017-10-26 22:13   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).