[dpdk-dev,RFC,3/4] ethdev: support GRE and L3VXLAN tunnel type

Message ID 20171129173106.120828-4-xuemingl@mellanox.com
State RFC, archived
Headers show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Xueming(Steven) Li Nov. 29, 2017, 5:31 p.m.
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
 lib/librte_ether/rte_eth_ctrl.h | 4 +++-
 lib/librte_ether/rte_ethdev.h   | 2 ++
 lib/librte_ether/rte_flow.c     | 1 +
 lib/librte_ether/rte_flow.h     | 7 +++++++
 4 files changed, 13 insertions(+), 1 deletion(-)

Patch

diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
index 8386904..ce111ad 100644
--- a/lib/librte_ether/rte_eth_ctrl.h
+++ b/lib/librte_ether/rte_eth_ctrl.h
@@ -83,7 +83,9 @@ 
 #define RTE_ETH_FLOW_VXLAN              19 /**< VXLAN protocol based flow */
 #define RTE_ETH_FLOW_GENEVE             20 /**< GENEVE protocol based flow */
 #define RTE_ETH_FLOW_NVGRE              21 /**< NVGRE protocol based flow */
-#define RTE_ETH_FLOW_MAX                22
+#define RTE_ETH_FLOW_L3VXLAN            22 /**< L3-VXLAN protocol based flow */
+#define RTE_ETH_FLOW_GRE                23 /**< GRE protocol based flow */
+#define RTE_ETH_FLOW_MAX                24
 
 /**
  * Feature filter types
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 341c2d6..baacc70 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -453,6 +453,8 @@  struct rte_eth_rss_conf {
 #define ETH_RSS_VXLAN              (1ULL << RTE_ETH_FLOW_VXLAN)
 #define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
 #define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
+#define ETH_RSS_L3VXLAN            (1ULL << RTE_ETH_FLOW_L3VXLAN)
+#define ETH_RSS_GRE                (1ULL << RTE_ETH_FLOW_GRE)
 
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c
index 6659063..44d8391 100644
--- a/lib/librte_ether/rte_flow.c
+++ b/lib/librte_ether/rte_flow.c
@@ -81,6 +81,7 @@  struct rte_flow_desc_data {
 	MK_FLOW_ITEM(GRE, sizeof(struct rte_flow_item_gre)),
 	MK_FLOW_ITEM(E_TAG, sizeof(struct rte_flow_item_e_tag)),
 	MK_FLOW_ITEM(NVGRE, sizeof(struct rte_flow_item_nvgre)),
+	MK_FLOW_ITEM(L3VXLAN, sizeof(struct rte_flow_item_vxlan)),
 };
 
 /** Generate flow_action[] entry. */
diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h
index c35558c..78c6d5c 100644
--- a/lib/librte_ether/rte_flow.h
+++ b/lib/librte_ether/rte_flow.h
@@ -300,6 +300,13 @@  enum rte_flow_item_type {
 	RTE_FLOW_ITEM_TYPE_GRE,
 
 	/**
+	 * Matches a L3-VXLAN header.
+	 *
+	 * See struct rte_flow_item_vxlan.
+	 */
+	RTE_FLOW_ITEM_TYPE_L3VXLAN,
+
+	/**
 	 * [META]
 	 *
 	 * Fuzzy pattern match, expect faster than default.