app/testpmd: add GRE key for raw encap/decap
authorXiaoyu Min <jackmin@mellanox.com>
Wed, 17 Jul 2019 12:27:10 +0000 (20:27 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 23 Jul 2019 12:31:35 +0000 (14:31 +0200)
GRE key (rte_flow_item_type_gre_key) is also needed in
raw encapsulation/decapsulation.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
app/test-pmd/cmdline_flow.c

index 8409e41..d08f016 100644 (file)
@@ -5683,6 +5683,7 @@ static const void *
 flow_item_default_mask(const struct rte_flow_item *item)
 {
        const void *mask = NULL;
+       static rte_be32_t gre_key_default_mask = RTE_BE32(UINT32_MAX);
 
        switch (item->type) {
        case RTE_FLOW_ITEM_TYPE_ANY:
@@ -5739,6 +5740,9 @@ flow_item_default_mask(const struct rte_flow_item *item)
        case RTE_FLOW_ITEM_TYPE_GRE:
                mask = &rte_flow_item_gre_mask;
                break;
+       case RTE_FLOW_ITEM_TYPE_GRE_KEY:
+               mask = &gre_key_default_mask;
+               break;
        case RTE_FLOW_ITEM_TYPE_META:
                mask = &rte_flow_item_meta_mask;
                break;
@@ -5824,6 +5828,9 @@ cmd_set_raw_parsed(const struct buffer *in)
                        size = sizeof(struct rte_flow_item_gre);
                        proto = 0x2F;
                        break;
+               case RTE_FLOW_ITEM_TYPE_GRE_KEY:
+                       size = sizeof(rte_be32_t);
+                       break;
                case RTE_FLOW_ITEM_TYPE_MPLS:
                        size = sizeof(struct rte_flow_item_mpls);
                        break;