[v2,3/3] app/testpmd: add GRE key for raw encap/decap

Message ID 962350e77b593e6b760f75932ebda405ac8bed83.1562074764.git.jackmin@mellanox.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series app/testpmd: support raw encap/decap actions |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Xiaoyu Min July 2, 2019, 1:53 p.m. UTC
  GRE key (rte_flow_item_type_gre_key) is also needed in
raw encapsulation/decapsulation.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
---
 app/test-pmd/cmdline_flow.c | 7 +++++++
 1 file changed, 7 insertions(+)
  

Patch

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index f3c0b7902f..5a05a5757a 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -5514,6 +5514,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:
@@ -5570,6 +5571,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;
@@ -5655,6 +5659,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;