From: Dekel Peled <dekelp@nvidia.com>
Date: Wed, 7 Oct 2020 13:28:43 +0000 (+0300)
Subject: app/testpmd: support query of age action
X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2f622174bf863563ed17aa9d298978bf88af75ce;p=dpdk.git

app/testpmd: support query of age action

Following ethdev update in the previous patch of this series, this
patch adds CLI support to query information related to AGE action.

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index d4be6948b2..fe31a9d52f 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1835,6 +1835,7 @@ port_flow_query(portid_t port_id, uint32_t rule,
 	union {
 		struct rte_flow_query_count count;
 		struct rte_flow_action_rss rss_conf;
+		struct rte_flow_query_age age;
 	} query;
 	int ret;
 
@@ -1857,6 +1858,7 @@ port_flow_query(portid_t port_id, uint32_t rule,
 	switch (action->type) {
 	case RTE_FLOW_ACTION_TYPE_COUNT:
 	case RTE_FLOW_ACTION_TYPE_RSS:
+	case RTE_FLOW_ACTION_TYPE_AGE:
 		break;
 	default:
 		printf("Cannot query action type %d (%s)\n",
@@ -1884,6 +1886,16 @@ port_flow_query(portid_t port_id, uint32_t rule,
 	case RTE_FLOW_ACTION_TYPE_RSS:
 		rss_config_display(&query.rss_conf);
 		break;
+	case RTE_FLOW_ACTION_TYPE_AGE:
+		printf("%s:\n"
+		       " aged: %u\n"
+		       " sec_since_last_hit_valid: %u\n"
+		       " sec_since_last_hit: %" PRIu32 "\n",
+		       name,
+		       query.age.aged,
+		       query.age.sec_since_last_hit_valid,
+		       query.age.sec_since_last_hit);
+		break;
 	default:
 		printf("Cannot display result for action type %d (%s)\n",
 		       action->type, name);