DPDK patches and discussions
 help / color / mirror / Atom feed
From: Gavin Li <gavinl@nvidia.com>
To: <matan@nvidia.com>, <viacheslavo@nvidia.com>, <orika@nvidia.com>,
	<thomas@monjalon.net>, Aman Singh <aman.deep.singh@intel.com>,
	Yuying Zhang <yuying.zhang@intel.com>
Cc: <dev@dpdk.org>, <rasland@nvidia.com>
Subject: [v1 2/2] app/testpmd: introduce VXLAN-GBP and VXLAN-GPE fields
Date: Fri, 17 May 2024 11:07:35 +0300	[thread overview]
Message-ID: <20240517080735.1787616-3-gavinl@nvidia.com> (raw)
In-Reply-To: <20240517080735.1787616-1-gavinl@nvidia.com>

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(+)

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.
 
-- 
2.34.1


  parent reply	other threads:[~2024-05-17  8:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17  8:07 [v1 0/2] extend VXLAN header to support more extensions Gavin Li
2024-05-17  8:07 ` [v1 1/2] net: " Gavin Li
2024-05-17  8:07 ` Gavin Li [this message]
2024-05-23  8:20   ` [v1 2/2] app/testpmd: introduce VXLAN-GBP and VXLAN-GPE fields Ori Kam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240517080735.1787616-3-gavinl@nvidia.com \
    --to=gavinl@nvidia.com \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.com \
    --cc=yuying.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).