[v1,2/2] app/testpmd: introduce VXLAN-GBP and VXLAN-GPE fields

Message ID 20240517080735.1787616-3-gavinl@nvidia.com (mailing list archive)
State New
Delegated to: Ferruh Yigit
Headers
Series extend VXLAN header to support more extensions |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-amd64-testing fail Testing issues
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-compile-amd64-testing success Testing PASS

Commit Message

Gavin Li May 17, 2024, 8:07 a.m. UTC
  After unification of VXLAN and all its extension protocols(VXLAN-GPE and
VXLAN-GBP currently), all related RTE items should be spicified after
'vxlan'. And it's user's responsibility to specify correct UDP port for
the protocol to be matched.

Below are the examples to match standard VXLAN, VXLAN-GPE and VXLAN-GBP.
To match standard vxlan,
... / udp dst is 4789 / vxlan ... / ...
To match VXLAN-GBP group policy ID 4321,
... / udp dst is 4789 / vxlan group_policy_id is 4321 ... / ...
To match VXLAN-GPE,
... / udp dst is 4790 / vxlan protocol is 2 ... / ...

Signed-off-by: Gavin Li <gavinl@nvidia.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
 app/test-pmd/cmdline_flow.c                 | 40 +++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  4 +++
 2 files changed, 44 insertions(+)
  

Comments

Ori Kam May 23, 2024, 8:20 a.m. UTC | #1
> -----Original Message-----
> From: Minggang(Gavin) Li <gavinl@nvidia.com>
> Sent: Friday, May 17, 2024 11:08 AM
> Subject: [v1 2/2] app/testpmd: introduce VXLAN-GBP and VXLAN-GPE fields
> 
> After unification of VXLAN and all its extension protocols(VXLAN-GPE and
> VXLAN-GBP currently), all related RTE items should be spicified after
> 'vxlan'. And it's user's responsibility to specify correct UDP port for
> the protocol to be matched.
> 
> Below are the examples to match standard VXLAN, VXLAN-GPE and VXLAN-
> GBP.
> To match standard vxlan,
> ... / udp dst is 4789 / vxlan ... / ...
> To match VXLAN-GBP group policy ID 4321,
> ... / udp dst is 4789 / vxlan group_policy_id is 4321 ... / ...
> To match VXLAN-GPE,
> ... / udp dst is 4790 / vxlan protocol is 2 ... / ...
> 
> Signed-off-by: Gavin Li <gavinl@nvidia.com>
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
> ---

Acked-by: Ori Kam <orika@nvidia.com>

Best,
Ori
  

Patch

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 60ee9337cf..78b31d9bcd 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -383,6 +383,10 @@  enum index {
 	ITEM_VXLAN,
 	ITEM_VXLAN_VNI,
 	ITEM_VXLAN_LAST_RSVD,
+	ITEM_VXLAN_FLAGS,
+	ITEM_VXLAN_EXT_GBP_GPI,
+	ITEM_VXLAN_EXT_GPE_PROTO,
+	ITEM_VXLAN_EXT_GPE_RSVD0,
 	ITEM_E_TAG,
 	ITEM_E_TAG_GRP_ECID_B,
 	ITEM_NVGRE,
@@ -1779,6 +1783,10 @@  static const enum index item_sctp[] = {
 static const enum index item_vxlan[] = {
 	ITEM_VXLAN_VNI,
 	ITEM_VXLAN_LAST_RSVD,
+	ITEM_VXLAN_FLAGS,
+	ITEM_VXLAN_EXT_GBP_GPI,
+	ITEM_VXLAN_EXT_GPE_PROTO,
+	ITEM_VXLAN_EXT_GPE_RSVD0,
 	ITEM_NEXT,
 	ZERO,
 };
@@ -4918,6 +4926,38 @@  static const struct token token_list[] = {
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan,
 					     hdr.rsvd1)),
 	},
+	[ITEM_VXLAN_FLAGS] = {
+		.name = "flags",
+		.help = "VXLAN flags",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan,
+					     flags)),
+	},
+	[ITEM_VXLAN_EXT_GBP_GPI] = {
+		.name = "group_policy_id",
+		.help = "VXLAN Group Based Policy ID",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan,
+					     hdr.policy_id)),
+	},
+	[ITEM_VXLAN_EXT_GPE_PROTO] = {
+		.name = "protocol",
+		.help = "VXLAN-GPE next protocol",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan,
+					     hdr.proto)),
+	},
+	[ITEM_VXLAN_EXT_GPE_RSVD0] = {
+		.name = "rsvd0_gpe",
+		.help = "VXLAN-GPE rsvd0",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan,
+					     hdr.rsvd0_gpe)),
+	},
 	[ITEM_E_TAG] = {
 		.name = "e_tag",
 		.help = "match E-Tag header",
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 2fbf9220d8..f1770ab950 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -3697,6 +3697,10 @@  This section lists supported pattern items and their attributes, if any.
 
   - ``vni {unsigned}``: VXLAN identifier.
   - ``last_rsvd {unsigned}``: VXLAN last reserved 8-bits.
+  - ``flags {unsigned}``: VXLAN flags
+  - ``group_policy_id {unsigned}``: VXLAN-GBP Group Policy ID.
+  - ``protocol {unsigned}`` : VXLAN-GPE next protocol
+  - ``rsvd0_gpe {unsigned}`` : VXLAN-GPE rsvd0
 
 - ``e_tag``: match IEEE 802.1BR E-Tag header.