DPDK patches and discussions
 help / color / mirror / Atom feed
* [V2 0/2] net: extend VXLAN header to support more extensions
@ 2024-06-04  6:27 Gavin Li
  2024-06-04  6:27 ` [V2 1/2] " Gavin Li
  2024-06-04  6:27 ` [V2 2/2] app/testpmd: introduce VXLAN-GBP and VXLAN-GPE fields Gavin Li
  0 siblings, 2 replies; 7+ messages in thread
From: Gavin Li @ 2024-06-04  6:27 UTC (permalink / raw)
  To: matan, viacheslavo, orika, thomas; +Cc: dev, rasland

In this patch series, all the VXLAN extension header will be merged with
VXLAN as union if the overlapped field has different format among
protocols. The existing VXLAN-GPE will be marked as deprecated and new
extensions of VXLAN should be added to VXLAN instead of a new RTE item.

RFC
https://patches.dpdk.org/project/dpdk/patch/20240130112520.1971315-2-gavinl@nvidia.com/

PMD changes
https://patches.dpdk.org/project/dpdk/patch/20240514032131.153409-1-rongweil@nvidia.com/

Gavin Li (2):
  net: extend VXLAN header to support more extensions
---
changelog:
v1->v2
        - removed deprecation (removal) note, it should be decided later
        - reworded deprecation comments to use @see for replacements
        - merged bits in a single place to avoid redefinitions
        - documented all bits
        - move big endian bit-fields first as it is the networking standard
---
  app/testpmd: introduce VXLAN-GBP and VXLAN-GPE fields
---
changelog:
v1->v2
        - add all supported bits in testpmd command line
        - documented all bits in testpmd doc
---

 app/test-pmd/cmdline_flow.c                 | 110 ++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  11 ++
 lib/ethdev/rte_flow.h                       |  20 +++-
 lib/net/rte_vxlan.h                         |  83 +++++++++++++--
 4 files changed, 211 insertions(+), 13 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [V2 1/2] net: extend VXLAN header to support more extensions
  2024-06-04  6:27 [V2 0/2] net: extend VXLAN header to support more extensions Gavin Li
@ 2024-06-04  6:27 ` Gavin Li
  2024-06-05  8:09   ` [V3 0/2] " Gavin Li
  2024-06-04  6:27 ` [V2 2/2] app/testpmd: introduce VXLAN-GBP and VXLAN-GPE fields Gavin Li
  1 sibling, 1 reply; 7+ messages in thread
From: Gavin Li @ 2024-06-04  6:27 UTC (permalink / raw)
  To: matan, viacheslavo, orika, thomas, Ferruh Yigit, Andrew Rybchenko
  Cc: dev, rasland

Currently, DPDK supports VXLAN and VXLAN-GPE with similar header
structures and we are working on adding support for VXLAN-GBP which is
another extension to VXLAN. More extension of VXLAN may be added in the
future.

VXLAN and VXLAN-GBP use the same UDP port(4789) while VXLAN-GPE uses a
different one, 4790. The three protocols have the same header length and
overall similar header structure as below.
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |R|R|R|R|I|R|R|R|            Reserved                           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                VXLAN Network Identifier (VNI) |   Reserved    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                           Figure 1: VXLAN Header

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |R|R|Ver|I|P|B|O|       Reserved                |Next Protocol  |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                VXLAN Network Identifier (VNI) |   Reserved    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                         Figure 2: VXLAN-GPE Header

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |G|R|R|R|I|R|R|R|R|D|R|R|A|R|R|R|        Group Policy ID        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |          VXLAN Network Identifier (VNI)       |   Reserved    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                          Figure 3: VXLAN-GBP Extension

Both VXLAN-GPE and VXLAN-GBP extended VXLAN by redefining its reserved
bits, which means the packets can be processed with same pattern and most
of the code can be reused. Instead of adding more new items by
copying/pasting code for the VXLAN extensions in the future, it’s better
to use existing VXLAN infrastructure and add support code in it.

In this patch, all the VXLAN extension header will be merged with VXLAN as
union if the overlapped field has different format among protocols. The
existing VXLAN-GPE will be marked as deprecated and new extensions of
VXLAN should be added to VXLAN instead of a new RTE item.

Signed-off-by: Gavin Li <gavinl@nvidia.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/ethdev/rte_flow.h | 20 +++++++++--
 lib/net/rte_vxlan.h   | 83 +++++++++++++++++++++++++++++++++++++------
 2 files changed, 90 insertions(+), 13 deletions(-)

diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 6e8ab1d4c7..b27d5aa94c 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -355,6 +355,9 @@ enum rte_flow_item_type {
 	RTE_FLOW_ITEM_TYPE_GENEVE,
 
 	/**
+	 * @deprecated
+	 * @see RTE_FLOW_ITEM_TYPE_VXLAN
+	 *
 	 * Matches a VXLAN-GPE header.
 	 *
 	 * See struct rte_flow_item_vxlan_gpe.
@@ -1103,7 +1106,12 @@ static const struct rte_flow_item_sctp rte_flow_item_sctp_mask = {
 /**
  * RTE_FLOW_ITEM_TYPE_VXLAN.
  *
- * Matches a VXLAN header (RFC 7348).
+ * Matches a VXLAN header (RFC 7348),
+ * including GPE (draft-ietf-nvo3-vxlan-gpe-13.txt)
+ * and GBP (draft-smith-vxlan-group-policy-05.txt).
+ *
+ * GPE is distinguished with its UDP port.
+ * UDP port may be specified with ``rte_eth_dev_udp_tunnel_port_add()``.
  */
 struct rte_flow_item_vxlan {
 	union {
@@ -1346,6 +1354,9 @@ static const struct rte_flow_item_geneve rte_flow_item_geneve_mask = {
 #endif
 
 /**
+ * @deprecated
+ * @see rte_flow_item_vxlan
+ *
  * RTE_FLOW_ITEM_TYPE_VXLAN_GPE (draft-ietf-nvo3-vxlan-gpe-05).
  *
  * Matches a VXLAN-GPE header.
@@ -1367,7 +1378,12 @@ struct rte_flow_item_vxlan_gpe {
 	};
 };
 
-/** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE. */
+/**
+ * @deprecated
+ * @see rte_flow_item_vxlan_mask
+ *
+ * Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE.
+ */
 #ifndef __cplusplus
 static const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask = {
 	.hdr.vni = "\xff\xff\xff",
diff --git a/lib/net/rte_vxlan.h b/lib/net/rte_vxlan.h
index 997fc784fc..8ce93ae569 100644
--- a/lib/net/rte_vxlan.h
+++ b/lib/net/rte_vxlan.h
@@ -23,27 +23,80 @@ extern "C" {
 
 /** VXLAN default port. */
 #define RTE_VXLAN_DEFAULT_PORT 4789
+/** VXLAN GPE port. */
 #define RTE_VXLAN_GPE_DEFAULT_PORT 4790
 
 /**
  * VXLAN protocol header.
  * Contains the 8-bit flag, 24-bit VXLAN Network Identifier and
- * Reserved fields (24 bits and 8 bits)
+ * extensions (Generic Protocol Extension, Group Based Policy).
  */
 __extension__ /* no named member in struct */
 struct rte_vxlan_hdr {
 	union {
+		rte_be32_t vx_flags; /**< flags (8 bits) + extensions (24 bits). */
 		struct {
-			rte_be32_t vx_flags; /**< flags (8) + Reserved (24). */
-			rte_be32_t vx_vni;   /**< VNI (24) + Reserved (8). */
-		};
+			union {
+				uint8_t flags; /**< Default is I bit, others are extensions. */
+				struct {
+#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
+					uint8_t flag_g:1,     /**< GBP bit. */
+						flag_rsvd:1,  /*   Reserved. */
+						flag_ver:2,   /**< GPE Protocol Version. */
+						flag_i:1,     /**< VNI bit. */
+						flag_p:1,     /**< GPE Next Protocol bit. */
+						flag_b:1,     /**< GPE Ingress-Replicated BUM. */
+						flag_o:1;     /**< GPE OAM Packet bit. */
+#elif RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
+					uint8_t flag_o:1,
+						flag_b:1,
+						flag_p:1,
+						flag_i:1,
+						flag_ver:2,
+						flag_rsvd:1,
+						flag_g:1;
+#endif
+				} __rte_packed;
+			}; /* end of 1st byte */
+			union {
+				uint8_t rsvd0[3]; /* Reserved for extensions. */
+				struct {
+#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
+					uint8_t rsvd0_gbp1:1, /*   Reserved. */
+						flag_d:1,     /**< GBP Don't Learn bit. */
+						rsvd0_gbp2:2, /*   Reserved. */
+						flag_a:1,     /**< GBP Applied bit. */
+						rsvd0_gbp3:3; /*   Reserved. */
+#elif RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
+					uint8_t rsvd0_gbp3:3,
+						flag_a:1,
+						rsvd0_gbp2:2,
+						flag_d:1,
+						rsvd0_gbp1:1;
+#endif
+					union {
+						uint16_t policy_id; /**< GBP Identifier. */
+						struct {
+							uint8_t rsvd0_gpe; /* Reserved. */
+							uint8_t proto; /**< GPE Next protocol. */
+								/* 0x01 : IPv4
+								 * 0x02 : IPv6
+								 * 0x03 : Ethernet
+								 * 0x04 : Network Service Header
+								 */
+						} __rte_packed;
+					};
+				} __rte_packed;
+			};
+		} __rte_packed;
+	}; /* end of 1st 32-bit word */
+	union {
+		rte_be32_t vx_vni; /**< VNI (24 bits) + reserved (8 bits). */
 		struct {
-			uint8_t    flags;    /**< Should be 8 (I flag). */
-			uint8_t    rsvd0[3]; /**< Reserved. */
-			uint8_t    vni[3];   /**< VXLAN identifier. */
-			uint8_t    rsvd1;    /**< Reserved. */
-		};
-	};
+			uint8_t    vni[3];   /**< VXLAN Identifier. */
+			uint8_t    rsvd1;    /*   Reserved. */
+		} __rte_packed;
+	}; /* end of 2nd 32-bit word */
 } __rte_packed;
 
 /** VXLAN tunnel header length. */
@@ -52,6 +105,9 @@ struct rte_vxlan_hdr {
 
 
 /**
+ * @deprecated
+ * @see rte_vxlan_hdr
+ *
  * VXLAN-GPE protocol header (draft-ietf-nvo3-vxlan-gpe-05).
  * Contains the 8-bit flag, 8-bit next-protocol, 24-bit VXLAN Network
  * Identifier and Reserved fields (16 bits and 8 bits).
@@ -75,7 +131,12 @@ struct rte_vxlan_gpe_hdr {
 	};
 } __rte_packed;
 
-/** VXLAN-GPE tunnel header length. */
+/**
+ * @deprecated
+ * @see RTE_ETHER_VXLAN_HLEN
+ *
+ * VXLAN-GPE tunnel header length.
+ */
 #define RTE_ETHER_VXLAN_GPE_HLEN (sizeof(struct rte_udp_hdr) + \
 		sizeof(struct rte_vxlan_gpe_hdr))
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [V2 2/2] app/testpmd: introduce VXLAN-GBP and VXLAN-GPE fields
  2024-06-04  6:27 [V2 0/2] net: extend VXLAN header to support more extensions Gavin Li
  2024-06-04  6:27 ` [V2 1/2] " Gavin Li
@ 2024-06-04  6:27 ` Gavin Li
  1 sibling, 0 replies; 7+ messages in thread
From: Gavin Li @ 2024-06-04  6:27 UTC (permalink / raw)
  To: matan, viacheslavo, orika, thomas, Aman Singh, Yuying Zhang; +Cc: dev, rasland

After unification of VXLAN and all its extension protocols(VXLAN-GPE and
VXLAN-GBP currently), all related RTE items should be specified 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 is 4321,
... / udp dst is 4789 / vxlan flag_g is 1 group_policy_id is 4321 ... / ...
To match VXLAN-GPE, next protocol is IPv6
... / udp dst is 4790 / vxlan flag_p is 1 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>
---
 app/test-pmd/cmdline_flow.c                 | 110 ++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  11 ++
 2 files changed, 121 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 60ee9337cf..6c8210ccd4 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -383,6 +383,17 @@ enum index {
 	ITEM_VXLAN,
 	ITEM_VXLAN_VNI,
 	ITEM_VXLAN_LAST_RSVD,
+	ITEM_VXLAN_FLAG_G,
+	ITEM_VXLAN_FLAG_VER,
+	ITEM_VXLAN_FLAG_I,
+	ITEM_VXLAN_FLAG_P,
+	ITEM_VXLAN_FLAG_B,
+	ITEM_VXLAN_FLAG_O,
+	ITEM_VXLAN_FLAG_D,
+	ITEM_VXLAN_FLAG_A,
+	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 +1790,17 @@ static const enum index item_sctp[] = {
 static const enum index item_vxlan[] = {
 	ITEM_VXLAN_VNI,
 	ITEM_VXLAN_LAST_RSVD,
+	ITEM_VXLAN_FLAG_G,
+	ITEM_VXLAN_FLAG_VER,
+	ITEM_VXLAN_FLAG_I,
+	ITEM_VXLAN_FLAG_P,
+	ITEM_VXLAN_FLAG_B,
+	ITEM_VXLAN_FLAG_O,
+	ITEM_VXLAN_FLAG_D,
+	ITEM_VXLAN_FLAG_A,
+	ITEM_VXLAN_EXT_GBP_GPI,
+	ITEM_VXLAN_EXT_GPE_PROTO,
+	ITEM_VXLAN_EXT_GPE_RSVD0,
 	ITEM_NEXT,
 	ZERO,
 };
@@ -4918,6 +4940,94 @@ static const struct token token_list[] = {
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan,
 					     hdr.rsvd1)),
 	},
+	[ITEM_VXLAN_FLAG_G] = {
+		.name = "flag_g",
+		.help = "VXLAN flag GBP bit",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_vxlan,
+					   hdr.flag_g, 1)),
+	},
+	[ITEM_VXLAN_FLAG_VER] = {
+		.name = "flag_ver",
+		.help = "VXLAN flag GPE version bits",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_vxlan,
+					   hdr.flag_ver, 2)),
+	},
+	[ITEM_VXLAN_FLAG_I] = {
+		.name = "flag_i",
+		.help = "VXLAN flag instance bit",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_vxlan,
+					   hdr.flag_i, 1)),
+	},
+	[ITEM_VXLAN_FLAG_P] = {
+		.name = "flag_p",
+		.help = "VXLAN flag GPE Next Protocol bit",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_vxlan,
+					   hdr.flag_p, 1)),
+	},
+	[ITEM_VXLAN_FLAG_B] = {
+		.name = "flag_b",
+		.help = "VXLAN flag GPE Ingress-Replicated BUM",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_vxlan,
+					   hdr.flag_b, 1)),
+	},
+	[ITEM_VXLAN_FLAG_O] = {
+		.name = "flag_o",
+		.help = "VXLAN flag GPE OAM Packet bit",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_vxlan,
+					   hdr.flag_o, 1)),
+	},
+	[ITEM_VXLAN_FLAG_D] = {
+		.name = "flag_d",
+		.help = "VXLAN flag GBP Don't Learn bit",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_vxlan,
+					   hdr.flag_d, 1)),
+	},
+	[ITEM_VXLAN_FLAG_A] = {
+		.name = "flag_a",
+		.help = "VXLAN flag GBP Applied bit",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_vxlan,
+					   hdr.flag_a, 1)),
+	},
+	[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 ecd040504e..5fb369c107 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -3697,6 +3697,17 @@ This section lists supported pattern items and their attributes, if any.
 
   - ``vni {unsigned}``: VXLAN identifier.
   - ``last_rsvd {unsigned}``: VXLAN last reserved 8-bits.
+  - ``flag_g {unsigned}``: VXLAN flag GBP bit
+  - ``flag_ver {unsigned}``: VXLAN flag GPE version bits
+  - ``flag_i {unsigned}``: VXLAN flag instance bit
+  - ``flag_p {unsigned}``: VXLAN flag GPE Next Protocol bit
+  - ``flag_b {unsigned}``: VXLAN flag GPE Ingress-Replicated BUM
+  - ``flag_o {unsigned}``: VXLAN flag GPE OAM Packet bit
+  - ``flag_d {unsigned}``: VXLAN flag GBP Don't Learn bit
+  - ``flag_a {unsigned}``: VXLAN flag GBP Applied bit
+  - ``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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [V3 0/2] net: extend VXLAN header to support more extensions
  2024-06-04  6:27 ` [V2 1/2] " Gavin Li
@ 2024-06-05  8:09   ` Gavin Li
  2024-06-05  8:09     ` [V3 1/2] " Gavin Li
                       ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Gavin Li @ 2024-06-05  8:09 UTC (permalink / raw)
  To: matan, viacheslavo, orika, thomas; +Cc: dev, rasland

In this patch series, all the VXLAN extension header will be merged with
VXLAN as union if the overlapped field has different format among
protocols. The existing VXLAN-GPE will be marked as deprecated and new
extensions of VXLAN should be added to VXLAN instead of a new RTE item.

RFC
https://patches.dpdk.org/project/dpdk/patch/20240130112520.1971315-2-gavinl@nvidia.com/

PMD changes
https://patches.dpdk.org/project/dpdk/patch/20240514032131.153409-1-rongweil@nvidia.com/

Gavin Li (2):
  net: extend VXLAN header to support more extensions
---
changelog:
v1->v2
        - removed deprecation (removal) note, it should be decided later
        - reworded deprecation comments to use @see for replacements
        - merged bits in a single place to avoid redefinitions
        - documented all bits
        - move big endian bit-fields first as it is the networking standard
---
  app/testpmd: support matching any VXLAN field
---
changelog:
v1->v2
        - add all supported bits in testpmd command line
        - documented all bits in testpmd doc
v2->v3
        - add three bytes rsvd0 fields in testpmd command line
        - remove rsvd_gpe from testpmd command line
        - remove all existing "vxlan-gpe" in testpmd and doc
        - consistent naming of "VXLAN GPE" and "VXLAN GBP"
        - other minor naming issues
---

 app/test-pmd/cmdline_flow.c                 | 195 +++++++++++++-------
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  35 ++--
 lib/ethdev/rte_flow.h                       |  20 +-
 lib/net/rte_vxlan.h                         |  83 +++++++--
 4 files changed, 240 insertions(+), 93 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [V3 1/2] net: extend VXLAN header to support more extensions
  2024-06-05  8:09   ` [V3 0/2] " Gavin Li
@ 2024-06-05  8:09     ` Gavin Li
  2024-06-05  8:09     ` [V3 2/2] app/testpmd: support matching any VXLAN field Gavin Li
  2024-06-11 14:53     ` [V3 0/2] net: extend VXLAN header to support more extensions Ferruh Yigit
  2 siblings, 0 replies; 7+ messages in thread
From: Gavin Li @ 2024-06-05  8:09 UTC (permalink / raw)
  To: matan, viacheslavo, orika, thomas, Ferruh Yigit, Andrew Rybchenko
  Cc: dev, rasland

VXLAN and VXLAN-GPE were supported with similar header structures.
In order to add VXLAN-GBP, which is another extension to VXLAN, both
extensions are merged in the original VXLAN header structure for an easier
usage. More VXLAN extensions may be added in the future in the same single
structure.

VXLAN and VXLAN-GBP use the same UDP port (4789), while VXLAN-GPE uses a
different port (4790).
The three protocols have the same header length and overall a similar
header structure as below.

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |R|R|R|R|I|R|R|R|            Reserved                           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                VXLAN Network Identifier (VNI) |   Reserved    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                           Figure 1: VXLAN Header

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |R|R|Ver|I|P|B|O|       Reserved                |Next Protocol  |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                VXLAN Network Identifier (VNI) |   Reserved    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                         Figure 2: VXLAN-GPE Header

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |G|R|R|R|I|R|R|R|R|D|R|R|A|R|R|R|        Group Policy ID        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |          VXLAN Network Identifier (VNI)       |   Reserved    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                          Figure 3: VXLAN-GBP Extension

Both GPE and GBP are extending VXLAN by using some reserved bits.
It means the packets can be processed with the same pattern and most of
the code can be reused.

The old field names are kept with the use of anonymous unions.
The Group Policy ID (GBP) and the Next Protocol (GPE) fields are
overlapping so they are in a union as well.

Another improvement is defining and documenting each bit.

Instead of adding flow items, a single VXLAN flow item is more flexible
as it uses the same header anyway.
GBP can be matches with the G bit.
GPE can be matched with the UDP port number.

VXLAN-GPE flow item and specific header are marked as deprecated.
A removal of the deprecated structures and macros may be proposed later.

Signed-off-by: Gavin Li <gavinl@nvidia.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/ethdev/rte_flow.h | 20 +++++++++--
 lib/net/rte_vxlan.h   | 83 +++++++++++++++++++++++++++++++++++++------
 2 files changed, 90 insertions(+), 13 deletions(-)

diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 6e8ab1d4c7..b27d5aa94c 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -355,6 +355,9 @@ enum rte_flow_item_type {
 	RTE_FLOW_ITEM_TYPE_GENEVE,
 
 	/**
+	 * @deprecated
+	 * @see RTE_FLOW_ITEM_TYPE_VXLAN
+	 *
 	 * Matches a VXLAN-GPE header.
 	 *
 	 * See struct rte_flow_item_vxlan_gpe.
@@ -1103,7 +1106,12 @@ static const struct rte_flow_item_sctp rte_flow_item_sctp_mask = {
 /**
  * RTE_FLOW_ITEM_TYPE_VXLAN.
  *
- * Matches a VXLAN header (RFC 7348).
+ * Matches a VXLAN header (RFC 7348),
+ * including GPE (draft-ietf-nvo3-vxlan-gpe-13.txt)
+ * and GBP (draft-smith-vxlan-group-policy-05.txt).
+ *
+ * GPE is distinguished with its UDP port.
+ * UDP port may be specified with ``rte_eth_dev_udp_tunnel_port_add()``.
  */
 struct rte_flow_item_vxlan {
 	union {
@@ -1346,6 +1354,9 @@ static const struct rte_flow_item_geneve rte_flow_item_geneve_mask = {
 #endif
 
 /**
+ * @deprecated
+ * @see rte_flow_item_vxlan
+ *
  * RTE_FLOW_ITEM_TYPE_VXLAN_GPE (draft-ietf-nvo3-vxlan-gpe-05).
  *
  * Matches a VXLAN-GPE header.
@@ -1367,7 +1378,12 @@ struct rte_flow_item_vxlan_gpe {
 	};
 };
 
-/** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE. */
+/**
+ * @deprecated
+ * @see rte_flow_item_vxlan_mask
+ *
+ * Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE.
+ */
 #ifndef __cplusplus
 static const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask = {
 	.hdr.vni = "\xff\xff\xff",
diff --git a/lib/net/rte_vxlan.h b/lib/net/rte_vxlan.h
index 997fc784fc..8ce93ae569 100644
--- a/lib/net/rte_vxlan.h
+++ b/lib/net/rte_vxlan.h
@@ -23,27 +23,80 @@ extern "C" {
 
 /** VXLAN default port. */
 #define RTE_VXLAN_DEFAULT_PORT 4789
+/** VXLAN GPE port. */
 #define RTE_VXLAN_GPE_DEFAULT_PORT 4790
 
 /**
  * VXLAN protocol header.
  * Contains the 8-bit flag, 24-bit VXLAN Network Identifier and
- * Reserved fields (24 bits and 8 bits)
+ * extensions (Generic Protocol Extension, Group Based Policy).
  */
 __extension__ /* no named member in struct */
 struct rte_vxlan_hdr {
 	union {
+		rte_be32_t vx_flags; /**< flags (8 bits) + extensions (24 bits). */
 		struct {
-			rte_be32_t vx_flags; /**< flags (8) + Reserved (24). */
-			rte_be32_t vx_vni;   /**< VNI (24) + Reserved (8). */
-		};
+			union {
+				uint8_t flags; /**< Default is I bit, others are extensions. */
+				struct {
+#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
+					uint8_t flag_g:1,     /**< GBP bit. */
+						flag_rsvd:1,  /*   Reserved. */
+						flag_ver:2,   /**< GPE Protocol Version. */
+						flag_i:1,     /**< VNI bit. */
+						flag_p:1,     /**< GPE Next Protocol bit. */
+						flag_b:1,     /**< GPE Ingress-Replicated BUM. */
+						flag_o:1;     /**< GPE OAM Packet bit. */
+#elif RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
+					uint8_t flag_o:1,
+						flag_b:1,
+						flag_p:1,
+						flag_i:1,
+						flag_ver:2,
+						flag_rsvd:1,
+						flag_g:1;
+#endif
+				} __rte_packed;
+			}; /* end of 1st byte */
+			union {
+				uint8_t rsvd0[3]; /* Reserved for extensions. */
+				struct {
+#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
+					uint8_t rsvd0_gbp1:1, /*   Reserved. */
+						flag_d:1,     /**< GBP Don't Learn bit. */
+						rsvd0_gbp2:2, /*   Reserved. */
+						flag_a:1,     /**< GBP Applied bit. */
+						rsvd0_gbp3:3; /*   Reserved. */
+#elif RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
+					uint8_t rsvd0_gbp3:3,
+						flag_a:1,
+						rsvd0_gbp2:2,
+						flag_d:1,
+						rsvd0_gbp1:1;
+#endif
+					union {
+						uint16_t policy_id; /**< GBP Identifier. */
+						struct {
+							uint8_t rsvd0_gpe; /* Reserved. */
+							uint8_t proto; /**< GPE Next protocol. */
+								/* 0x01 : IPv4
+								 * 0x02 : IPv6
+								 * 0x03 : Ethernet
+								 * 0x04 : Network Service Header
+								 */
+						} __rte_packed;
+					};
+				} __rte_packed;
+			};
+		} __rte_packed;
+	}; /* end of 1st 32-bit word */
+	union {
+		rte_be32_t vx_vni; /**< VNI (24 bits) + reserved (8 bits). */
 		struct {
-			uint8_t    flags;    /**< Should be 8 (I flag). */
-			uint8_t    rsvd0[3]; /**< Reserved. */
-			uint8_t    vni[3];   /**< VXLAN identifier. */
-			uint8_t    rsvd1;    /**< Reserved. */
-		};
-	};
+			uint8_t    vni[3];   /**< VXLAN Identifier. */
+			uint8_t    rsvd1;    /*   Reserved. */
+		} __rte_packed;
+	}; /* end of 2nd 32-bit word */
 } __rte_packed;
 
 /** VXLAN tunnel header length. */
@@ -52,6 +105,9 @@ struct rte_vxlan_hdr {
 
 
 /**
+ * @deprecated
+ * @see rte_vxlan_hdr
+ *
  * VXLAN-GPE protocol header (draft-ietf-nvo3-vxlan-gpe-05).
  * Contains the 8-bit flag, 8-bit next-protocol, 24-bit VXLAN Network
  * Identifier and Reserved fields (16 bits and 8 bits).
@@ -75,7 +131,12 @@ struct rte_vxlan_gpe_hdr {
 	};
 } __rte_packed;
 
-/** VXLAN-GPE tunnel header length. */
+/**
+ * @deprecated
+ * @see RTE_ETHER_VXLAN_HLEN
+ *
+ * VXLAN-GPE tunnel header length.
+ */
 #define RTE_ETHER_VXLAN_GPE_HLEN (sizeof(struct rte_udp_hdr) + \
 		sizeof(struct rte_vxlan_gpe_hdr))
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [V3 2/2] app/testpmd: support matching any VXLAN field
  2024-06-05  8:09   ` [V3 0/2] " Gavin Li
  2024-06-05  8:09     ` [V3 1/2] " Gavin Li
@ 2024-06-05  8:09     ` Gavin Li
  2024-06-11 14:53     ` [V3 0/2] net: extend VXLAN header to support more extensions Ferruh Yigit
  2 siblings, 0 replies; 7+ messages in thread
From: Gavin Li @ 2024-06-05  8:09 UTC (permalink / raw)
  To: matan, viacheslavo, orika, thomas, Aman Singh, Yuying Zhang; +Cc: dev, rasland

VXLAN extensions (VXLAN-GPE and VXLAN-GBP) are unified
in a single VXLAN flow item.

It is user responsibility to explicitly match VXLAN-GPE with its UDP port.
Below are 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 is 4321,
... / udp dst is 4789 / vxlan flag_g is 1 group_policy_id is 4321 ... / ...
To match VXLAN-GPE, next protocol is IPv6
... / udp dst is 4790 / vxlan flag_p is 1 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>
---
 app/test-pmd/cmdline_flow.c                 | 195 +++++++++++++-------
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  35 ++--
 2 files changed, 150 insertions(+), 80 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 60ee9337cf..b98c134202 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -382,6 +382,19 @@ enum index {
 	ITEM_SCTP_CKSUM,
 	ITEM_VXLAN,
 	ITEM_VXLAN_VNI,
+	ITEM_VXLAN_FLAG_G,
+	ITEM_VXLAN_FLAG_VER,
+	ITEM_VXLAN_FLAG_I,
+	ITEM_VXLAN_FLAG_P,
+	ITEM_VXLAN_FLAG_B,
+	ITEM_VXLAN_FLAG_O,
+	ITEM_VXLAN_FLAG_D,
+	ITEM_VXLAN_FLAG_A,
+	ITEM_VXLAN_GBP_ID,
+	ITEM_VXLAN_GPE_PROTO,
+	ITEM_VXLAN_FIRST_RSVD,
+	ITEM_VXLAN_SECND_RSVD,
+	ITEM_VXLAN_THIRD_RSVD,
 	ITEM_VXLAN_LAST_RSVD,
 	ITEM_E_TAG,
 	ITEM_E_TAG_GRP_ECID_B,
@@ -410,12 +423,6 @@ enum index {
 	ITEM_GENEVE_VNI,
 	ITEM_GENEVE_PROTO,
 	ITEM_GENEVE_OPTLEN,
-	ITEM_VXLAN_GPE,
-	ITEM_VXLAN_GPE_VNI,
-	ITEM_VXLAN_GPE_PROTO,
-	ITEM_VXLAN_GPE_FLAGS,
-	ITEM_VXLAN_GPE_RSVD0,
-	ITEM_VXLAN_GPE_RSVD1,
 	ITEM_ARP_ETH_IPV4,
 	ITEM_ARP_ETH_IPV4_SHA,
 	ITEM_ARP_ETH_IPV4_SPA,
@@ -1604,7 +1611,6 @@ static const enum index next_item[] = {
 	ITEM_GTPC,
 	ITEM_GTPU,
 	ITEM_GENEVE,
-	ITEM_VXLAN_GPE,
 	ITEM_ARP_ETH_IPV4,
 	ITEM_IPV6_EXT,
 	ITEM_IPV6_FRAG_EXT,
@@ -1778,6 +1784,19 @@ static const enum index item_sctp[] = {
 
 static const enum index item_vxlan[] = {
 	ITEM_VXLAN_VNI,
+	ITEM_VXLAN_FLAG_G,
+	ITEM_VXLAN_FLAG_VER,
+	ITEM_VXLAN_FLAG_I,
+	ITEM_VXLAN_FLAG_P,
+	ITEM_VXLAN_FLAG_B,
+	ITEM_VXLAN_FLAG_O,
+	ITEM_VXLAN_FLAG_D,
+	ITEM_VXLAN_FLAG_A,
+	ITEM_VXLAN_GBP_ID,
+	ITEM_VXLAN_GPE_PROTO,
+	ITEM_VXLAN_FIRST_RSVD,
+	ITEM_VXLAN_SECND_RSVD,
+	ITEM_VXLAN_THIRD_RSVD,
 	ITEM_VXLAN_LAST_RSVD,
 	ITEM_NEXT,
 	ZERO,
@@ -1844,16 +1863,6 @@ static const enum index item_geneve[] = {
 	ZERO,
 };
 
-static const enum index item_vxlan_gpe[] = {
-	ITEM_VXLAN_GPE_VNI,
-	ITEM_VXLAN_GPE_PROTO,
-	ITEM_VXLAN_GPE_FLAGS,
-	ITEM_VXLAN_GPE_RSVD0,
-	ITEM_VXLAN_GPE_RSVD1,
-	ITEM_NEXT,
-	ZERO,
-};
-
 static const enum index item_arp_eth_ipv4[] = {
 	ITEM_ARP_ETH_IPV4_SHA,
 	ITEM_ARP_ETH_IPV4_SPA,
@@ -4910,6 +4919,110 @@ static const struct token token_list[] = {
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan, hdr.vni)),
 	},
+	[ITEM_VXLAN_FLAG_G] = {
+		.name = "flag_g",
+		.help = "VXLAN GBP bit",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_vxlan,
+					   hdr.flag_g, 1)),
+	},
+	[ITEM_VXLAN_FLAG_VER] = {
+		.name = "flag_ver",
+		.help = "VXLAN GPE version",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_vxlan,
+					   hdr.flag_ver, 2)),
+	},
+	[ITEM_VXLAN_FLAG_I] = {
+		.name = "flag_i",
+		.help = "VXLAN Instance bit",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_vxlan,
+					   hdr.flag_i, 1)),
+	},
+	[ITEM_VXLAN_FLAG_P] = {
+		.name = "flag_p",
+		.help = "VXLAN GPE Next Protocol bit",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_vxlan,
+					   hdr.flag_p, 1)),
+	},
+	[ITEM_VXLAN_FLAG_B] = {
+		.name = "flag_b",
+		.help = "VXLAN GPE Ingress-Replicated BUM",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_vxlan,
+					   hdr.flag_b, 1)),
+	},
+	[ITEM_VXLAN_FLAG_O] = {
+		.name = "flag_o",
+		.help = "VXLAN GPE OAM Packet bit",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_vxlan,
+					   hdr.flag_o, 1)),
+	},
+	[ITEM_VXLAN_FLAG_D] = {
+		.name = "flag_d",
+		.help = "VXLAN GBP Don't Learn bit",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_vxlan,
+					   hdr.flag_d, 1)),
+	},
+	[ITEM_VXLAN_FLAG_A] = {
+		.name = "flag_a",
+		.help = "VXLAN GBP Applied bit",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_vxlan,
+					   hdr.flag_a, 1)),
+	},
+	[ITEM_VXLAN_GBP_ID] = {
+		.name = "group_policy_id",
+		.help = "VXLAN GBP 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_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_FIRST_RSVD] = {
+		.name = "first_rsvd",
+		.help = "VXLAN rsvd0 first byte",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan,
+					     hdr.rsvd0[0])),
+	},
+	[ITEM_VXLAN_SECND_RSVD] = {
+		.name = "second_rsvd",
+		.help = "VXLAN rsvd0 second byte",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan,
+					     hdr.rsvd0[1])),
+	},
+	[ITEM_VXLAN_THIRD_RSVD] = {
+		.name = "third_rsvd",
+		.help = "VXLAN rsvd0 third byte",
+		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan,
+					     hdr.rsvd0[2])),
+	},
 	[ITEM_VXLAN_LAST_RSVD] = {
 		.name = "last_rsvd",
 		.help = "VXLAN last reserved bits",
@@ -5127,54 +5240,6 @@ static const struct token token_list[] = {
 						  ver_opt_len_o_c_rsvd0,
 						  "\x3f\x00")),
 	},
-	[ITEM_VXLAN_GPE] = {
-		.name = "vxlan-gpe",
-		.help = "match VXLAN-GPE header",
-		.priv = PRIV_ITEM(VXLAN_GPE,
-				  sizeof(struct rte_flow_item_vxlan_gpe)),
-		.next = NEXT(item_vxlan_gpe),
-		.call = parse_vc,
-	},
-	[ITEM_VXLAN_GPE_VNI] = {
-		.name = "vni",
-		.help = "VXLAN-GPE identifier",
-		.next = NEXT(item_vxlan_gpe, NEXT_ENTRY(COMMON_UNSIGNED),
-			     item_param),
-		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan_gpe,
-					     hdr.vni)),
-	},
-	[ITEM_VXLAN_GPE_PROTO] = {
-		.name = "protocol",
-		.help = "VXLAN-GPE next protocol",
-		.next = NEXT(item_vxlan_gpe, NEXT_ENTRY(COMMON_UNSIGNED),
-			     item_param),
-		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan_gpe,
-					     protocol)),
-	},
-	[ITEM_VXLAN_GPE_FLAGS] = {
-		.name = "flags",
-		.help = "VXLAN-GPE flags",
-		.next = NEXT(item_vxlan_gpe, NEXT_ENTRY(COMMON_UNSIGNED),
-			     item_param),
-		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan_gpe,
-					     flags)),
-	},
-	[ITEM_VXLAN_GPE_RSVD0] = {
-		.name = "rsvd0",
-		.help = "VXLAN-GPE rsvd0",
-		.next = NEXT(item_vxlan_gpe, NEXT_ENTRY(COMMON_UNSIGNED),
-			     item_param),
-		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan_gpe,
-					     rsvd0)),
-	},
-	[ITEM_VXLAN_GPE_RSVD1] = {
-		.name = "rsvd1",
-		.help = "VXLAN-GPE rsvd1",
-		.next = NEXT(item_vxlan_gpe, NEXT_ENTRY(COMMON_UNSIGNED),
-			     item_param),
-		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan_gpe,
-					     rsvd1)),
-	},
 	[ITEM_ARP_ETH_IPV4] = {
 		.name = "arp_eth_ipv4",
 		.help = "match ARP header for Ethernet/IPv4",
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index ecd040504e..1de1420b94 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -214,7 +214,6 @@ For example:
      vxlan
      geneve
      nvgre
-     vxlan-gpe
 
 show port (module_eeprom|eeprom)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1104,12 +1103,12 @@ Where:
 * ``ip|udp|tcp|sctp`` always relate to  the inner layer.
 
 * ``outer-ip`` relates to the outer IP layer (only for IPv4) in the case where the packet is recognized
-  as a tunnel packet by the forwarding engine (geneve, gre, gtp, ipip, vxlan and vxlan-gpe are
-  supported). See also the ``csum parse-tunnel`` command.
+  as a tunnel packet by the forwarding engine (geneve, gre, gtp, ipip and vxlan are supported).
+  See also the ``csum parse-tunnel`` command.
 
 * ``outer-udp`` relates to the outer UDP layer in the case where the packet is recognized
-  as a tunnel packet by the forwarding engine (geneve, gtp, vxlan and vxlan-gpe are
-  supported). See also the ``csum parse-tunnel`` command.
+  as a tunnel packet by the forwarding engine (geneve, gtp and vxlan are supported).
+  See also the ``csum parse-tunnel`` command.
 
 .. note::
 
@@ -1124,7 +1123,7 @@ engine::
    testpmd> csum parse-tunnel (on|off) (tx_port_id)
 
 If enabled, the csum forward engine will try to recognize supported
-tunnel headers (geneve, gtp, gre, ipip, vxlan, vxlan-gpe).
+tunnel headers (geneve, gtp, gre, ipip, vxlan).
 
 If disabled, treat tunnel packets as non-tunneled packets (a inner
 header is handled as a packet payload).
@@ -2222,7 +2221,7 @@ port config udp_tunnel_port
 
 Add/remove UDP tunnel port for VXLAN/GENEVE tunneling protocols::
 
-    testpmd> port config (port_id) udp_tunnel_port add|rm vxlan|geneve|vxlan-gpe|ecpri (udp_port)
+    testpmd> port config (port_id) udp_tunnel_port add|rm vxlan|geneve|ecpri (udp_port)
 
 port config tx_metadata
 ~~~~~~~~~~~~~~~~~~~~~~~
@@ -3696,7 +3695,20 @@ This section lists supported pattern items and their attributes, if any.
 - ``vxlan``: match VXLAN header.
 
   - ``vni {unsigned}``: VXLAN identifier.
-  - ``last_rsvd {unsigned}``: VXLAN last reserved 8-bits.
+  - ``flag_g {unsigned}``: VXLAN flag GBP bit.
+  - ``flag_ver {unsigned}``: VXLAN flag GPE version.
+  - ``flag_i {unsigned}``: VXLAN flag Instance bit.
+  - ``flag_p {unsigned}``: VXLAN flag GPE Next Protocol bit.
+  - ``flag_b {unsigned}``: VXLAN flag GPE Ingress-Replicated BUM.
+  - ``flag_o {unsigned}``: VXLAN flag GPE OAM Packet bit.
+  - ``flag_d {unsigned}``: VXLAN flag GBP Don't Learn bit.
+  - ``flag_a {unsigned}``: VXLAN flag GBP Applied bit.
+  - ``group_policy_id {unsigned}``: VXLAN GBP Group Policy ID.
+  - ``protocol {unsigned}`` : VXLAN GPE next protocol.
+  - ``first_rsvd {unsigned}`` : VXLAN rsvd0 first byte.
+  - ``secnd_rsvd {unsigned}`` : VXLAN rsvd0 second byte.
+  - ``third_rsvd {unsigned}`` : VXLAN rsvd0 third byte.
+  - ``last_rsvd {unsigned}``: VXLAN last reserved byte.
 
 - ``e_tag``: match IEEE 802.1BR E-Tag header.
 
@@ -3745,13 +3757,6 @@ This section lists supported pattern items and their attributes, if any.
   - ``data {hex string}``: GENEVE option data, the length is defined by
     ``length`` field.
 
-- ``vxlan-gpe``: match VXLAN-GPE header.
-
-  - ``vni {unsigned}``: VXLAN-GPE identifier.
-  - ``flags {unsigned}``: VXLAN-GPE flags.
-  - ``rsvd0 {unsigned}``: VXLAN-GPE reserved field 0.
-  - ``rsvd1 {unsigned}``: VXLAN-GPE reserved field 1.
-
 - ``arp_eth_ipv4``: match ARP header for Ethernet/IPv4.
 
   - ``sha {MAC-48}``: sender hardware address.
-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [V3 0/2] net: extend VXLAN header to support more extensions
  2024-06-05  8:09   ` [V3 0/2] " Gavin Li
  2024-06-05  8:09     ` [V3 1/2] " Gavin Li
  2024-06-05  8:09     ` [V3 2/2] app/testpmd: support matching any VXLAN field Gavin Li
@ 2024-06-11 14:53     ` Ferruh Yigit
  2 siblings, 0 replies; 7+ messages in thread
From: Ferruh Yigit @ 2024-06-11 14:53 UTC (permalink / raw)
  To: Gavin Li, matan, viacheslavo, orika, thomas; +Cc: dev, rasland

On 6/5/2024 9:09 AM, Gavin Li wrote:
> In this patch series, all the VXLAN extension header will be merged with
> VXLAN as union if the overlapped field has different format among
> protocols. The existing VXLAN-GPE will be marked as deprecated and new
> extensions of VXLAN should be added to VXLAN instead of a new RTE item.
> 
> RFC
> https://patches.dpdk.org/project/dpdk/patch/20240130112520.1971315-2-gavinl@nvidia.com/
> 
> PMD changes
> https://patches.dpdk.org/project/dpdk/patch/20240514032131.153409-1-rongweil@nvidia.com/
> 
> Gavin Li (2):
>   net: extend VXLAN header to support more extensions
> ---
> changelog:
> v1->v2
>         - removed deprecation (removal) note, it should be decided later
>         - reworded deprecation comments to use @see for replacements
>         - merged bits in a single place to avoid redefinitions
>         - documented all bits
>         - move big endian bit-fields first as it is the networking standard
> ---
>   app/testpmd: support matching any VXLAN field
> ---
> changelog:
> v1->v2
>         - add all supported bits in testpmd command line
>         - documented all bits in testpmd doc
> v2->v3
>         - add three bytes rsvd0 fields in testpmd command line
>         - remove rsvd_gpe from testpmd command line
>         - remove all existing "vxlan-gpe" in testpmd and doc
>         - consistent naming of "VXLAN GPE" and "VXLAN GBP"
>         - other minor naming issues
> 

Series applied to dpdk-next-net/main, thanks.

Resolved conflict because of 'last_rsvd' modification in
'rte_vxlan_hdr', please double check the final code.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-06-11 14:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-04  6:27 [V2 0/2] net: extend VXLAN header to support more extensions Gavin Li
2024-06-04  6:27 ` [V2 1/2] " Gavin Li
2024-06-05  8:09   ` [V3 0/2] " Gavin Li
2024-06-05  8:09     ` [V3 1/2] " Gavin Li
2024-06-05  8:09     ` [V3 2/2] app/testpmd: support matching any VXLAN field Gavin Li
2024-06-11 14:53     ` [V3 0/2] net: extend VXLAN header to support more extensions Ferruh Yigit
2024-06-04  6:27 ` [V2 2/2] app/testpmd: introduce VXLAN-GBP and VXLAN-GPE fields Gavin Li

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