DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v2] ethdev: add GENEVE encapsulation and decapsulation actions
@ 2025-11-14  6:19 Sunyang Wu
  0 siblings, 0 replies; only message in thread
From: Sunyang Wu @ 2025-11-14  6:19 UTC (permalink / raw)
  To: dev; +Cc: orika, thomas, stephen

Add new flow action types for GENEVE tunnel manipulation:

1. RTE_FLOW_ACTION_TYPE_GENEVE_ENCAP - For encapsulating packets into
GENEVE tunnels
2. RTE_FLOW_ACTION_TYPE_GENEVE_DECAP - For decapsulating packets from
GENEVE tunnels
3. struct rte_flow_action_geneve_encap - Data structure to define tunnel
encapsulation parameters

These actions allow users to build more flexible network virtualization
solutions using GENEVE tunnels as specified by RFC8926, which are added
at the end of the enum to maintain ABI compatibility.

Signed-off-by: Sunyang Wu <sunyang.wu@jaguarmicro.com>
---
 lib/ethdev/rte_flow.h | 50 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 3d2ccdeb92..84b903f8e1 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -3263,6 +3263,23 @@ enum rte_flow_action_type {
 	 * @see struct rte_flow_action_jump_to_table_index.
 	 */
 	RTE_FLOW_ACTION_TYPE_JUMP_TO_TABLE_INDEX,
+
+	/**
+	 * Encapsulate flow in GENEVE tunnel defined in the
+	 * rte_flow_action_geneve_encap action structure.
+	 *
+	 * See struct rte_flow_action_geneve_encap.
+	 */
+	RTE_FLOW_ACTION_TYPE_GENEVE_ENCAP,
+
+	/**
+	 * Decapsulate outer most GENEVE tunnel from matched flow.
+	 *
+	 * If flow pattern does not define a valid GENEVE tunnel (as specified by
+	 * RFC8296) then the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION
+	 * error.
+	 */
+	RTE_FLOW_ACTION_TYPE_GENEVE_DECAP,
 };
 
 /**
@@ -3738,6 +3755,39 @@ struct rte_flow_action_nvgre_encap {
 	struct rte_flow_item *definition;
 };
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ACTION_TYPE_GENEVE_ENCAP
+ *
+ * GENEVE tunnel end-point encapsulation data definition
+ *
+ * The tunnel definition is provided through the flow item pattern  the
+ * provided pattern must conform with RFC8926. The flow definition must be
+ * provided in order from the RTE_FLOW_ITEM_TYPE_ETH definition up the end item
+ * which is specified by RTE_FLOW_ITEM_TYPE_END.
+ *
+ * The mask field allows user to specify which fields in the flow item
+ * definitions can be ignored and which have valid data and can be used
+ * verbatim.
+ *
+ * Note: the last field is not used in the definition of a tunnel and can be
+ * ignored.
+ *
+ * Valid flow definition for RTE_FLOW_ACTION_TYPE_GENEVE_ENCAP include:
+ *
+ * - ETH / IPV4 / GENEVE / END
+ * - ETH / VLAN / IPV6 / GENEVE / END
+ */
+struct rte_flow_action_geneve_encap {
+	/**
+	 * Encapsulating geneve tunnel definition
+	 * (terminated by the END pattern item).
+	 */
+	struct rte_flow_item *definition;
+};
+
 /**
  * @warning
  * @b EXPERIMENTAL: this structure may change without prior notice
-- 
2.19.0.rc0.windows.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-11-14  6:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-14  6:19 [PATCH v2] ethdev: add GENEVE encapsulation and decapsulation actions Sunyang Wu

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