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(+)
> -----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
@@ -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",
@@ -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.