app/testpmd: enhance GTP support
authorDekel Peled <dekelp@mellanox.com>
Wed, 25 Mar 2020 08:12:31 +0000 (10:12 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Apr 2020 11:57:06 +0000 (13:57 +0200)
This patch adds CLI option to enter the v_pt_rsv_flags value for GTP
flow pattern item.
It also adds GTP as valid item in raw_encap and raw_decap setting.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
app/test-pmd/cmdline_flow.c

index a781545..4877ac6 100644 (file)
@@ -170,6 +170,7 @@ enum index {
        ITEM_FUZZY,
        ITEM_FUZZY_THRESH,
        ITEM_GTP,
+       ITEM_GTP_FLAGS,
        ITEM_GTP_MSG_TYPE,
        ITEM_GTP_TEID,
        ITEM_GTPC,
@@ -938,6 +939,7 @@ static const enum index item_gre_key[] = {
 };
 
 static const enum index item_gtp[] = {
+       ITEM_GTP_FLAGS,
        ITEM_GTP_MSG_TYPE,
        ITEM_GTP_TEID,
        ITEM_NEXT,
@@ -2347,12 +2349,18 @@ static const struct token token_list[] = {
                .next = NEXT(item_gtp),
                .call = parse_vc,
        },
+       [ITEM_GTP_FLAGS] = {
+               .name = "v_pt_rsv_flags",
+               .help = "GTP flags",
+               .next = NEXT(item_gtp, NEXT_ENTRY(UNSIGNED), item_param),
+               .args = ARGS(ARGS_ENTRY(struct rte_flow_item_gtp,
+                                       v_pt_rsv_flags)),
+       },
        [ITEM_GTP_MSG_TYPE] = {
                .name = "msg_type",
                .help = "GTP message type",
                .next = NEXT(item_gtp, NEXT_ENTRY(UNSIGNED), item_param),
-               .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_gtp,
-                                            msg_type)),
+               .args = ARGS(ARGS_ENTRY(struct rte_flow_item_gtp, msg_type)),
        },
        [ITEM_GTP_TEID] = {
                .name = "teid",
@@ -6604,6 +6612,9 @@ cmd_set_raw_parsed(const struct buffer *in)
                        size = sizeof(struct rte_flow_item_ah);
                        proto = 0x33;
                        break;
+               case RTE_FLOW_ITEM_TYPE_GTP:
+                       size = sizeof(struct rte_flow_item_gtp);
+                       break;
                case RTE_FLOW_ITEM_TYPE_PFCP:
                        size = sizeof(struct rte_flow_item_pfcp);
                        break;