DPDK patches and discussions
 help / color / mirror / Atom feed
From: Beilei Xing <beilei.xing@intel.com>
To: jingjing.wu@intel.com
Cc: helin.zhang@intel.com, dev@dpdk.org
Subject: [dpdk-dev] [PATCH 4/4] net/i40e: refine consistent tunnel filter
Date: Fri,  3 Mar 2017 17:31:37 +0800	[thread overview]
Message-ID: <1488533497-27682-5-git-send-email-beilei.xing@intel.com> (raw)
In-Reply-To: <1488533497-27682-1-git-send-email-beilei.xing@intel.com>

Add i40e_tunnel_type enumeration type to refine consistent
tunnel filter, it will be esay to add new tunnel type for
i40e.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c |  8 ++++----
 drivers/net/i40e/i40e_ethdev.h | 18 ++++++++++++++++--
 drivers/net/i40e/i40e_flow.c   |  6 +++---
 3 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 43afd5b..91bfd73 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -6960,7 +6960,7 @@ i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf,
 
 	pfilter->element.inner_vlan =
 		rte_cpu_to_le_16(tunnel_filter->inner_vlan);
-	if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) {
+	if (tunnel_filter->ip_type == I40E_TUNNEL_IPTYPE_IPV4) {
 		ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV4;
 		ipv4_addr = rte_be_to_cpu_32(tunnel_filter->ip_addr.ipv4_addr);
 		rte_memcpy(&pfilter->element.ipaddr.v4.data,
@@ -6980,13 +6980,13 @@ i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf,
 
 	/* check tunneled type */
 	switch (tunnel_filter->tunnel_type) {
-	case RTE_TUNNEL_TYPE_VXLAN:
+	case I40E_TUNNEL_TYPE_VXLAN:
 		tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_VXLAN;
 		break;
-	case RTE_TUNNEL_TYPE_NVGRE:
+	case I40E_TUNNEL_TYPE_NVGRE:
 		tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_NVGRE_OMAC;
 		break;
-	case RTE_TUNNEL_TYPE_IP_IN_GRE:
+	case I40E_TUNNEL_TYPE_IP_IN_GRE:
 		tun_type = I40E_AQC_ADD_CLOUD_TNL_TYPE_IP;
 		break;
 	default:
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 3c8a420..3e9b129 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -531,6 +531,20 @@ struct i40e_tunnel_rule {
 };
 
 /**
+ * Tunnel type.
+ */
+enum i40e_tunnel_type {
+	I40E_TUNNEL_TYPE_NONE = 0,
+	I40E_TUNNEL_TYPE_VXLAN,
+	I40E_TUNNEL_TYPE_GENEVE,
+	I40E_TUNNEL_TYPE_TEREDO,
+	I40E_TUNNEL_TYPE_NVGRE,
+	I40E_TUNNEL_TYPE_IP_IN_GRE,
+	I40E_L2_TUNNEL_TYPE_E_TAG,
+	I40E_TUNNEL_TYPE_MAX,
+};
+
+/**
  * Tunneling Packet filter configuration.
  */
 struct i40e_tunnel_filter_conf {
@@ -538,7 +552,7 @@ struct i40e_tunnel_filter_conf {
 	struct ether_addr inner_mac;    /**< Inner MAC address to match. */
 	uint16_t inner_vlan;            /**< Inner VLAN to match. */
 	uint32_t outer_vlan;            /**< Outer VLAN to match */
-	enum rte_tunnel_iptype ip_type; /**< IP address type. */
+	enum i40e_tunnel_iptype ip_type; /**< IP address type. */
 	/**
 	 * Outer destination IP address to match if ETH_TUNNEL_FILTER_OIP
 	 * is set in filter_type, or inner destination IP address to match
@@ -550,7 +564,7 @@ struct i40e_tunnel_filter_conf {
 	} ip_addr;
 	/** Flags from ETH_TUNNEL_FILTER_XX - see above. */
 	uint16_t filter_type;
-	enum rte_eth_tunnel_type tunnel_type; /**< Tunnel Type. */
+	enum i40e_tunnel_type tunnel_type; /**< Tunnel Type. */
 	uint32_t tenant_id;     /**< Tenant ID to match. VNI, GRE key... */
 	uint16_t queue_id;      /**< Queue assigned to if match. */
 	uint8_t is_to_vf;       /**< 0 - to PF, 1 - to VF */
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 03c7026..3e8c63a 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -1324,7 +1324,7 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev,
 			}
 			break;
 		case RTE_FLOW_ITEM_TYPE_IPV4:
-			filter->ip_type = RTE_TUNNEL_IPTYPE_IPV4;
+			filter->ip_type = I40E_TUNNEL_IPTYPE_IPV4;
 			/* IPv4 is used to describe protocol,
 			 * spec and mask should be NULL.
 			 */
@@ -1337,7 +1337,7 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev,
 			}
 			break;
 		case RTE_FLOW_ITEM_TYPE_IPV6:
-			filter->ip_type = RTE_TUNNEL_IPTYPE_IPV6;
+			filter->ip_type = I40E_TUNNEL_IPTYPE_IPV6;
 			/* IPv6 is used to describe protocol,
 			 * spec and mask should be NULL.
 			 */
@@ -1480,7 +1480,7 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev,
 		return -rte_errno;
 	}
 
-	filter->tunnel_type = RTE_TUNNEL_TYPE_VXLAN;
+	filter->tunnel_type = I40E_TUNNEL_TYPE_VXLAN;
 
 	return 0;
 }
-- 
2.5.5

  parent reply	other threads:[~2017-03-03  9:32 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-03  9:31 [dpdk-dev] [PATCH 0/4] support replace filter function Beilei Xing
2017-03-03  9:31 ` [dpdk-dev] [PATCH 1/4] net/i40e: support replace filter type Beilei Xing
2017-03-08 15:50   ` Ferruh Yigit
2017-03-09  5:59     ` Xing, Beilei
2017-03-09 10:01       ` Ferruh Yigit
2017-03-09 10:43         ` Xing, Beilei
2017-03-03  9:31 ` [dpdk-dev] [PATCH 2/4] net/i40e: rework tunnel filter functions Beilei Xing
2017-03-08 15:50   ` Ferruh Yigit
2017-03-09  6:00     ` Xing, Beilei
2017-03-03  9:31 ` [dpdk-dev] [PATCH 3/4] net/i40e: support tunnel filter to VF Beilei Xing
2017-03-08 15:50   ` Ferruh Yigit
2017-03-09  6:08     ` Xing, Beilei
2017-03-27 16:34       ` Ferruh Yigit
2017-03-03  9:31 ` Beilei Xing [this message]
2017-03-08 15:50   ` [dpdk-dev] [PATCH 4/4] net/i40e: refine consistent tunnel filter Ferruh Yigit
2017-03-09  6:11     ` Xing, Beilei
2017-03-08 15:50 ` [dpdk-dev] [PATCH 0/4] support replace filter function Ferruh Yigit
2017-03-09  5:13   ` Xing, Beilei
2017-03-23 10:46 ` [dpdk-dev] [PATCH v2 0/4] Rework tunnel filter functions Beilei Xing
2017-03-23 10:46   ` [dpdk-dev] [PATCH v2 1/4] net/i40e: rework " Beilei Xing
2017-03-27  9:47     ` Wu, Jingjing
2017-03-27 10:33       ` Xing, Beilei
2017-03-23 10:46   ` [dpdk-dev] [PATCH v2 2/4] net/i40e: change tunnel filter function name Beilei Xing
2017-03-23 10:46   ` [dpdk-dev] [PATCH v2 3/4] net/i40e: support tunnel filter to VF Beilei Xing
2017-03-27  9:54     ` Wu, Jingjing
2017-03-27 10:37       ` Xing, Beilei
2017-03-23 10:46   ` [dpdk-dev] [PATCH v2 4/4] net/i40e: refine consistent tunnel filter Beilei Xing
2017-03-28  3:23   ` [dpdk-dev] [PATCH v3 0/4] Rework tunnel filter functions Beilei Xing
2017-03-28  3:23     ` [dpdk-dev] [PATCH v3 1/4] net/i40e: rework " Beilei Xing
2017-03-28  3:23     ` [dpdk-dev] [PATCH v3 2/4] net/i40e: change tunnel filter function name Beilei Xing
2017-03-28  3:23     ` [dpdk-dev] [PATCH v3 3/4] net/i40e: support tunnel filter to VF Beilei Xing
2017-03-28  3:23     ` [dpdk-dev] [PATCH v3 4/4] net/i40e: refine consistent tunnel filter Beilei Xing
2017-03-28  9:28     ` [dpdk-dev] [PATCH v4 0/4] Rework tunnel filter functions Beilei Xing
2017-03-28  9:28       ` [dpdk-dev] [PATCH v4 1/4] net/i40e: rework " Beilei Xing
2017-03-28  9:28       ` [dpdk-dev] [PATCH v4 2/4] net/i40e: change tunnel filter function name Beilei Xing
2017-03-28  9:28       ` [dpdk-dev] [PATCH v4 3/4] net/i40e: support tunnel filter to VF Beilei Xing
2017-03-28  9:28       ` [dpdk-dev] [PATCH v4 4/4] net/i40e: refine consistent tunnel filter Beilei Xing
2017-03-29 13:23       ` [dpdk-dev] [PATCH v4 0/4] Rework tunnel filter functions Wu, Jingjing
2017-03-30 13:03         ` Ferruh Yigit

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=1488533497-27682-5-git-send-email-beilei.xing@intel.com \
    --to=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=jingjing.wu@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).