ethdev: support flow aging
[dpdk.git] / app / test-pmd / cmdline_flow.c
index 4877ac6..45bcff3 100644 (file)
@@ -343,6 +343,8 @@ enum index {
        ACTION_SET_IPV4_DSCP_VALUE,
        ACTION_SET_IPV6_DSCP,
        ACTION_SET_IPV6_DSCP_VALUE,
+       ACTION_AGE,
+       ACTION_AGE_TIMEOUT,
 };
 
 /** Maximum size for pattern in struct rte_flow_item_raw. */
@@ -1037,7 +1039,6 @@ static const enum index item_pppoes[] = {
 };
 
 static const enum index item_pppoe_proto_id[] = {
-       ITEM_PPPOE_PROTO_ID,
        ITEM_NEXT,
        ZERO,
 };
@@ -1146,6 +1147,7 @@ static const enum index next_action[] = {
        ACTION_SET_META,
        ACTION_SET_IPV4_DSCP,
        ACTION_SET_IPV6_DSCP,
+       ACTION_AGE,
        ZERO,
 };
 
@@ -1371,6 +1373,13 @@ static const enum index action_set_ipv6_dscp[] = {
        ZERO,
 };
 
+static const enum index action_age[] = {
+       ACTION_AGE,
+       ACTION_AGE_TIMEOUT,
+       ACTION_NEXT,
+       ZERO,
+};
+
 static int parse_set_raw_encap_decap(struct context *, const struct token *,
                                     const char *, unsigned int,
                                     void *, unsigned int);
@@ -2649,11 +2658,14 @@ static const struct token token_list[] = {
                                        session_id)),
        },
        [ITEM_PPPOE_PROTO_ID] = {
-               .name = "proto_id",
+               .name = "pppoe_proto_id",
                .help = "match PPPoE session protocol identifier",
                .priv = PRIV_ITEM(PPPOE_PROTO_ID,
                                sizeof(struct rte_flow_item_pppoe_proto_id)),
-               .next = NEXT(item_pppoe_proto_id),
+               .next = NEXT(item_pppoe_proto_id, NEXT_ENTRY(UNSIGNED),
+                            item_param),
+               .args = ARGS(ARGS_ENTRY_HTON
+                            (struct rte_flow_item_pppoe_proto_id, proto_id)),
                .call = parse_vc,
        },
        [ITEM_HIGIG2] = {
@@ -3692,6 +3704,22 @@ static const struct token token_list[] = {
                             (struct rte_flow_action_set_dscp, dscp)),
                .call = parse_vc_conf,
        },
+       [ACTION_AGE] = {
+               .name = "age",
+               .help = "set a specific metadata header",
+               .next = NEXT(action_age),
+               .priv = PRIV_ACTION(AGE,
+                       sizeof(struct rte_flow_action_age)),
+               .call = parse_vc,
+       },
+       [ACTION_AGE_TIMEOUT] = {
+               .name = "timeout",
+               .help = "flow age timeout value",
+               .args = ARGS(ARGS_ENTRY_BF(struct rte_flow_action_age,
+                                          timeout, 24)),
+               .next = NEXT(action_age, NEXT_ENTRY(UNSIGNED)),
+               .call = parse_vc_conf,
+       },
 };
 
 /** Remove and return last entry from argument stack. */