app/testpmd: support query of age action
authorDekel Peled <dekelp@nvidia.com>
Wed, 7 Oct 2020 13:28:43 +0000 (16:28 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 16 Oct 2020 17:48:17 +0000 (19:48 +0200)
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>
app/test-pmd/config.c

index d4be694..fe31a9d 100644 (file)
@@ -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);