All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH 1/4] i40e: Remove CONFIG_I40E_VXLAN
@ 2015-08-20 18:46 Anjali Singhai Jain
  2015-08-20 18:46 ` [Intel-wired-lan] [PATCH 2/4] geneve: Add geneve udp port offload for ethernet devices Anjali Singhai Jain
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Anjali Singhai Jain @ 2015-08-20 18:46 UTC (permalink / raw)
  To: intel-wired-lan

If the kernel flag CONFIG_VXLAN is true or CONFIG_VXLAN_MODULE is true,
enable VXLAN offload in the driver.

Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
---
 drivers/net/ethernet/intel/Kconfig          | 11 -----------
 drivers/net/ethernet/intel/i40e/i40e.h      |  4 ----
 drivers/net/ethernet/intel/i40e/i40e_main.c | 14 ++++----------
 3 files changed, 4 insertions(+), 25 deletions(-)

diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
index 4163b16..061e4e0 100644
--- a/drivers/net/ethernet/intel/Kconfig
+++ b/drivers/net/ethernet/intel/Kconfig
@@ -269,17 +269,6 @@ config I40E
 	  To compile this driver as a module, choose M here. The module
 	  will be called i40e.
 
-config I40E_VXLAN
-	bool "Virtual eXtensible Local Area Network Support"
-	default n
-	depends on I40E && VXLAN && !(I40E=y && VXLAN=m)
-	---help---
-	  This allows one to create VXLAN virtual interfaces that provide
-	  Layer 2 Networks over Layer 3 Networks. VXLAN is often used
-	  to tunnel virtual network infrastructure in virtualized environments.
-	  Say Y here if you want to use Virtual eXtensible Local Area Network
-	  (VXLAN) in the driver.
-
 config I40E_DCB
 	bool "Data Center Bridging (DCB) Support"
 	default n
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index c9fa289..257f7d8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -274,11 +274,9 @@ struct i40e_pf {
 	u32 fd_atr_cnt;
 	u32 fd_tcp_rule;
 
-#ifdef CONFIG_I40E_VXLAN
 	__be16  vxlan_ports[I40E_MAX_PF_UDP_OFFLOAD_PORTS];
 	u16 pending_vxlan_bitmap;
 
-#endif
 	enum i40e_interrupt_policy int_policy;
 	u16 rx_itr_default;
 	u16 tx_itr_default;
@@ -316,9 +314,7 @@ struct i40e_pf {
 #define I40E_FLAG_FD_ATR_ENABLED		BIT_ULL(22)
 #define I40E_FLAG_PTP				BIT_ULL(25)
 #define I40E_FLAG_MFP_ENABLED			BIT_ULL(26)
-#ifdef CONFIG_I40E_VXLAN
 #define I40E_FLAG_VXLAN_FILTER_SYNC		BIT_ULL(27)
-#endif
 #define I40E_FLAG_PORT_ID_VALID			BIT_ULL(28)
 #define I40E_FLAG_DCB_CAPABLE			BIT_ULL(29)
 #define I40E_FLAG_RSS_AQ_CAPABLE		BIT_ULL(31)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index aef0a4c..05081d1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -28,7 +28,7 @@
 #include "i40e.h"
 #include "i40e_helper.h"
 #include "i40e_diag.h"
-#ifdef CONFIG_I40E_VXLAN
+#if defined(CONFIG_VXLAN) || defined(CONFIG_VXLAN_MODULE)
 #include <net/vxlan.h>
 #endif
 
@@ -4934,7 +4934,7 @@ int i40e_open(struct net_device *netdev)
 						       TCP_FLAG_CWR) >> 16);
 	wr32(&pf->hw, I40E_GLLAN_TSOMSK_L, be32_to_cpu(TCP_FLAG_CWR) >> 16);
 
-#ifdef CONFIG_I40E_VXLAN
+#if defined(CONFIG_VXLAN) || defined(CONFIG_VXLAN_MODULE)
 	vxlan_get_rx_port(netdev);
 #endif
 
@@ -6659,13 +6659,13 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
 	i40e_flush(hw);
 }
 
-#ifdef CONFIG_I40E_VXLAN
 /**
  * i40e_sync_vxlan_filters_subtask - Sync the VSI filter list with HW
  * @pf: board private structure
  **/
 static void i40e_sync_vxlan_filters_subtask(struct i40e_pf *pf)
 {
+#if defined(CONFIG_VXLAN) || defined(CONFIG_VXLAN_MODULE)
 	struct i40e_hw *hw = &pf->hw;
 	i40e_status ret;
 	__be16 port;
@@ -6699,9 +6699,9 @@ static void i40e_sync_vxlan_filters_subtask(struct i40e_pf *pf)
 			}
 		}
 	}
+#endif
 }
 
-#endif
 /**
  * i40e_service_task - Run the driver's async subtasks
  * @work: pointer to work_struct containing our data
@@ -6725,9 +6725,7 @@ static void i40e_service_task(struct work_struct *work)
 	i40e_watchdog_subtask(pf);
 	i40e_fdir_reinit_subtask(pf);
 	i40e_sync_filters_subtask(pf);
-#ifdef CONFIG_I40E_VXLAN
 	i40e_sync_vxlan_filters_subtask(pf);
-#endif
 	i40e_clean_adminq_subtask(pf);
 
 	i40e_service_event_complete(pf);
@@ -7944,7 +7942,6 @@ static int i40e_set_features(struct net_device *netdev,
 	return 0;
 }
 
-#ifdef CONFIG_I40E_VXLAN
 /**
  * i40e_get_vxlan_port_idx - Lookup a possibly offloaded for Rx UDP port
  * @pf: board private structure
@@ -8039,7 +8036,6 @@ static void i40e_del_vxlan_port(struct net_device *netdev,
 	}
 }
 
-#endif
 static int i40e_get_phys_port_id(struct net_device *netdev,
 				 struct netdev_phys_item_id *ppid)
 {
@@ -8262,10 +8258,8 @@ static const struct net_device_ops i40e_netdev_ops = {
 	.ndo_get_vf_config	= i40e_ndo_get_vf_config,
 	.ndo_set_vf_link_state	= i40e_ndo_set_vf_link_state,
 	.ndo_set_vf_spoofchk	= i40e_ndo_set_vf_spoofchk,
-#ifdef CONFIG_I40E_VXLAN
 	.ndo_add_vxlan_port	= i40e_add_vxlan_port,
 	.ndo_del_vxlan_port	= i40e_del_vxlan_port,
-#endif
 	.ndo_get_phys_port_id	= i40e_get_phys_port_id,
 	.ndo_fdb_add		= i40e_ndo_fdb_add,
 	.ndo_features_check	= i40e_features_check,
-- 
1.8.1.4


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

* [Intel-wired-lan] [PATCH 2/4] geneve: Add geneve udp port offload for ethernet devices
  2015-08-20 18:46 [Intel-wired-lan] [PATCH 1/4] i40e: Remove CONFIG_I40E_VXLAN Anjali Singhai Jain
@ 2015-08-20 18:46 ` Anjali Singhai Jain
  2015-08-20 20:32   ` Keller, Jacob E
  2015-08-20 20:37   ` Keller, Jacob E
  2015-08-20 18:46 ` [Intel-wired-lan] [PATCH 3/4] i40e: Generalize the UDP tunnel offload flow Anjali Singhai Jain
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 15+ messages in thread
From: Anjali Singhai Jain @ 2015-08-20 18:46 UTC (permalink / raw)
  To: intel-wired-lan

Add ndo_ops to add/del UDP ports to a device that supports geneve
offload.

v2:Added comments for new ndo_ops and minor format fix.

Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
---
 include/linux/netdevice.h | 20 +++++++++++++++++++-
 net/ipv4/geneve_core.c    | 22 ++++++++++++++++++++++
 2 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index f3bb290..d6f00c7 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1016,6 +1016,19 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
  *	address family that vxlan is not listening to anymore. The operation
  *	is protected by the vxlan_net->sock_lock.
  *
+ * void (*ndo_add_geneve_port)(struct net_device *dev,
+ *			      sa_family_t sa_family, __be16 port);
+ *	Called by geneve to notiy a driver about the UDP port and socket
+ *	address family that geneve is listnening to. It is called only when
+ *	a new port starts listening. The operation is protected by the
+ *	geneve_net->sock_lock.
+ *
+ * void (*ndo_del_geneve_port)(struct net_device *dev,
+ *			      sa_family_t sa_family, __be16 port);
+ *	Called by geneve to notify the driver about a UDP port and socket
+ *	address family that geneve is not listening to anymore. The operation
+ *	is protected by the geneve_net->sock_lock.
+ *
  * void* (*ndo_dfwd_add_station)(struct net_device *pdev,
  *				 struct net_device *dev)
  *	Called by upper layer devices to accelerate switching or other
@@ -1210,7 +1223,12 @@ struct net_device_ops {
 	void			(*ndo_del_vxlan_port)(struct  net_device *dev,
 						      sa_family_t sa_family,
 						      __be16 port);
-
+	void			(*ndo_add_geneve_port)(struct net_device *dev,
+						      sa_family_t sa_family,
+						      __be16 port);
+	void			(*ndo_del_geneve_port)(struct net_device *dev,
+						      sa_family_t sa_family,
+						      __be16 port);
 	void*			(*ndo_dfwd_add_station)(struct net_device *pdev,
 							struct net_device *dev);
 	void			(*ndo_dfwd_del_station)(struct net_device *pdev,
diff --git a/net/ipv4/geneve_core.c b/net/ipv4/geneve_core.c
index 311a4ba..9ea9082 100644
--- a/net/ipv4/geneve_core.c
+++ b/net/ipv4/geneve_core.c
@@ -234,8 +234,11 @@ static int geneve_gro_complete(struct sk_buff *skb, int nhoff,
 
 static void geneve_notify_add_rx_port(struct geneve_sock *gs)
 {
+	struct net_device *dev;
 	struct sock *sk = gs->sock->sk;
+	struct net *net = sock_net(sk);
 	sa_family_t sa_family = sk->sk_family;
+	__be16 port = inet_sk(sk)->inet_sport;
 	int err;
 
 	if (sa_family == AF_INET) {
@@ -244,12 +247,31 @@ static void geneve_notify_add_rx_port(struct geneve_sock *gs)
 			pr_warn("geneve: udp_add_offload failed with status %d\n",
 				err);
 	}
+
+	rcu_read_lock();
+	for_each_netdev_rcu(net, dev) {
+		if (dev->netdev_ops->ndo_add_geneve_port)
+			dev->netdev_ops->ndo_add_geneve_port(dev, sa_family,
+							     port);
+	}
+	rcu_read_unlock();
 }
 
 static void geneve_notify_del_rx_port(struct geneve_sock *gs)
 {
+	struct net_device *dev;
 	struct sock *sk = gs->sock->sk;
+	struct net *net = sock_net(sk);
 	sa_family_t sa_family = sk->sk_family;
+	__be16 port = inet_sk(sk)->inet_sport;
+
+	rcu_read_lock();
+	for_each_netdev_rcu(net, dev) {
+		if (dev->netdev_ops->ndo_del_geneve_port)
+			dev->netdev_ops->ndo_del_geneve_port(dev, sa_family,
+							     port);
+	}
+	rcu_read_unlock();
 
 	if (sa_family == AF_INET)
 		udp_del_offload(&gs->udp_offloads);
-- 
1.8.1.4


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

* [Intel-wired-lan] [PATCH 3/4] i40e: Generalize the UDP tunnel offload flow
  2015-08-20 18:46 [Intel-wired-lan] [PATCH 1/4] i40e: Remove CONFIG_I40E_VXLAN Anjali Singhai Jain
  2015-08-20 18:46 ` [Intel-wired-lan] [PATCH 2/4] geneve: Add geneve udp port offload for ethernet devices Anjali Singhai Jain
@ 2015-08-20 18:46 ` Anjali Singhai Jain
  2015-08-21 22:54   ` Bowers, AndrewX
  2015-08-20 18:46 ` [Intel-wired-lan] [PATCH 4/4] i40e: geneve tunnel offload support Anjali Singhai Jain
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Anjali Singhai Jain @ 2015-08-20 18:46 UTC (permalink / raw)
  To: intel-wired-lan

This patch generalizes the implementation for UDP based tunnel offloads
so that VXLAN and any other UDP based tunnel protocols such
as Geneve can utilize it.

Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Kiran Patil <kiran.patil@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e.h      | 11 +++++--
 drivers/net/ethernet/intel/i40e/i40e_main.c | 50 ++++++++++++++---------------
 drivers/net/ethernet/intel/i40e/i40e_txrx.c |  6 ++--
 drivers/net/ethernet/intel/i40e/i40e_txrx.h |  2 +-
 4 files changed, 37 insertions(+), 32 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 257f7d8..71752c6 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -237,6 +237,11 @@ struct i40e_tc_configuration {
 	struct i40e_tc_info tc_info[I40E_MAX_TRAFFIC_CLASS];
 };
 
+struct i40e_udp_port_config {
+	__be16 index;
+	u8 type;
+};
+
 /* struct that defines the Ethernet device */
 struct i40e_pf {
 	struct pci_dev *pdev;
@@ -274,8 +279,8 @@ struct i40e_pf {
 	u32 fd_atr_cnt;
 	u32 fd_tcp_rule;
 
-	__be16  vxlan_ports[I40E_MAX_PF_UDP_OFFLOAD_PORTS];
-	u16 pending_vxlan_bitmap;
+	struct i40e_udp_port_config udp_ports[I40E_MAX_PF_UDP_OFFLOAD_PORTS];
+	u16 pending_udp_bitmap;
 
 	enum i40e_interrupt_policy int_policy;
 	u16 rx_itr_default;
@@ -314,7 +319,7 @@ struct i40e_pf {
 #define I40E_FLAG_FD_ATR_ENABLED		BIT_ULL(22)
 #define I40E_FLAG_PTP				BIT_ULL(25)
 #define I40E_FLAG_MFP_ENABLED			BIT_ULL(26)
-#define I40E_FLAG_VXLAN_FILTER_SYNC		BIT_ULL(27)
+#define I40E_FLAG_UDP_FILTER_SYNC              BIT_ULL(27)
 #define I40E_FLAG_PORT_ID_VALID			BIT_ULL(28)
 #define I40E_FLAG_DCB_CAPABLE			BIT_ULL(29)
 #define I40E_FLAG_RSS_AQ_CAPABLE		BIT_ULL(31)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 05081d1..bbc704b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -6660,10 +6660,10 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
 }
 
 /**
- * i40e_sync_vxlan_filters_subtask - Sync the VSI filter list with HW
+ * i40e_sync_udp_filters_subtask - Sync the VSI filter list with HW
  * @pf: board private structure
  **/
-static void i40e_sync_vxlan_filters_subtask(struct i40e_pf *pf)
+static void i40e_sync_udp_filters_subtask(struct i40e_pf *pf)
 {
 #if defined(CONFIG_VXLAN) || defined(CONFIG_VXLAN_MODULE)
 	struct i40e_hw *hw = &pf->hw;
@@ -6671,18 +6671,18 @@ static void i40e_sync_vxlan_filters_subtask(struct i40e_pf *pf)
 	__be16 port;
 	int i;
 
-	if (!(pf->flags & I40E_FLAG_VXLAN_FILTER_SYNC))
+	if (!(pf->flags & I40E_FLAG_UDP_FILTER_SYNC))
 		return;
 
-	pf->flags &= ~I40E_FLAG_VXLAN_FILTER_SYNC;
+	pf->flags &= ~I40E_FLAG_UDP_FILTER_SYNC;
 
 	for (i = 0; i < I40E_MAX_PF_UDP_OFFLOAD_PORTS; i++) {
-		if (pf->pending_vxlan_bitmap & BIT_ULL(i)) {
-			pf->pending_vxlan_bitmap &= ~BIT_ULL(i);
-			port = pf->vxlan_ports[i];
+		if (pf->pending_udp_bitmap & BIT_ULL(i)) {
+			pf->pending_udp_bitmap &= ~BIT_ULL(i);
+			port = pf->udp_ports[i].index;
 			if (port)
 				ret = i40e_aq_add_udp_tunnel(hw, ntohs(port),
-						     I40E_AQC_TUNNEL_TYPE_VXLAN,
+						     pf->udp_ports[i].type,
 						     NULL, NULL);
 			else
 				ret = i40e_aq_del_udp_tunnel(hw, i, NULL);
@@ -6695,7 +6695,7 @@ static void i40e_sync_vxlan_filters_subtask(struct i40e_pf *pf)
 					 i40e_stat_str(&pf->hw, ret),
 					 i40e_aq_str(&pf->hw,
 						    pf->hw.aq.asq_last_status));
-				pf->vxlan_ports[i] = 0;
+				pf->udp_ports[i].index = 0;
 			}
 		}
 	}
@@ -6725,7 +6725,7 @@ static void i40e_service_task(struct work_struct *work)
 	i40e_watchdog_subtask(pf);
 	i40e_fdir_reinit_subtask(pf);
 	i40e_sync_filters_subtask(pf);
-	i40e_sync_vxlan_filters_subtask(pf);
+	i40e_sync_udp_filters_subtask(pf);
 	i40e_clean_adminq_subtask(pf);
 
 	i40e_service_event_complete(pf);
@@ -7943,18 +7943,18 @@ static int i40e_set_features(struct net_device *netdev,
 }
 
 /**
- * i40e_get_vxlan_port_idx - Lookup a possibly offloaded for Rx UDP port
+ * i40e_get_udp_port_idx - Lookup a possibly offloaded for Rx UDP port
  * @pf: board private structure
  * @port: The UDP port to look up
  *
  * Returns the index number or I40E_MAX_PF_UDP_OFFLOAD_PORTS if port not found
  **/
-static u8 i40e_get_vxlan_port_idx(struct i40e_pf *pf, __be16 port)
+static u8 i40e_get_udp_port_idx(struct i40e_pf *pf, __be16 port)
 {
 	u8 i;
 
 	for (i = 0; i < I40E_MAX_PF_UDP_OFFLOAD_PORTS; i++) {
-		if (pf->vxlan_ports[i] == port)
+		if (pf->udp_ports[i].index == port)
 			return i;
 	}
 
@@ -7979,28 +7979,28 @@ static void i40e_add_vxlan_port(struct net_device *netdev,
 	if (sa_family == AF_INET6)
 		return;
 
-	idx = i40e_get_vxlan_port_idx(pf, port);
+	idx = i40e_get_udp_port_idx(pf, port);
 
 	/* Check if port already exists */
 	if (idx < I40E_MAX_PF_UDP_OFFLOAD_PORTS) {
-		netdev_info(netdev, "vxlan port %d already offloaded\n",
+		netdev_info(netdev, "UDP port %d already offloaded\n",
 			    ntohs(port));
 		return;
 	}
 
 	/* Now check if there is space to add the new port */
-	next_idx = i40e_get_vxlan_port_idx(pf, 0);
-
+	next_idx = i40e_get_udp_port_idx(pf, 0);
 	if (next_idx == I40E_MAX_PF_UDP_OFFLOAD_PORTS) {
-		netdev_info(netdev, "maximum number of vxlan UDP ports reached, not adding port %d\n",
+		netdev_info(netdev, "maximum number of UDP ports reached, not adding port %d\n",
 			    ntohs(port));
 		return;
 	}
 
 	/* New port: add it and mark its index in the bitmap */
-	pf->vxlan_ports[next_idx] = port;
-	pf->pending_vxlan_bitmap |= BIT_ULL(next_idx);
-	pf->flags |= I40E_FLAG_VXLAN_FILTER_SYNC;
+	pf->udp_ports[next_idx].index = port;
+	pf->udp_ports[next_idx].type = I40E_AQC_TUNNEL_TYPE_VXLAN;
+	pf->pending_udp_bitmap |= BIT_ULL(next_idx);
+	pf->flags |= I40E_FLAG_UDP_FILTER_SYNC;
 }
 
 /**
@@ -8020,16 +8020,16 @@ static void i40e_del_vxlan_port(struct net_device *netdev,
 	if (sa_family == AF_INET6)
 		return;
 
-	idx = i40e_get_vxlan_port_idx(pf, port);
+	idx = i40e_get_udp_port_idx(pf, port);
 
 	/* Check if port already exists */
 	if (idx < I40E_MAX_PF_UDP_OFFLOAD_PORTS) {
 		/* if port exists, set it to 0 (mark for deletion)
 		 * and make it pending
 		 */
-		pf->vxlan_ports[idx] = 0;
-		pf->pending_vxlan_bitmap |= BIT_ULL(idx);
-		pf->flags |= I40E_FLAG_VXLAN_FILTER_SYNC;
+		pf->udp_ports[idx].index = 0;
+		pf->pending_udp_bitmap |= BIT_ULL(idx);
+		pf->flags |= I40E_FLAG_UDP_FILTER_SYNC;
 	} else {
 		netdev_warn(netdev, "vxlan port %d was not found, not deleting\n",
 			    ntohs(port));
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 0fbcd05..424c5cc 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -2007,7 +2007,7 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb,
 	if (!(tx_flags & (I40E_TX_FLAGS_IPV4 | I40E_TX_FLAGS_IPV6)))
 		return;
 
-	if (!(tx_flags & I40E_TX_FLAGS_VXLAN_TUNNEL)) {
+	if (!(tx_flags & I40E_TX_FLAGS_UDP_TUNNEL)) {
 		/* snag network header to get L4 type and address */
 		hdr.network = skb_network_header(skb);
 
@@ -2092,7 +2092,7 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb,
 		     I40E_TXD_FLTR_QW1_FD_STATUS_SHIFT;
 
 	dtype_cmd |= I40E_TXD_FLTR_QW1_CNT_ENA_MASK;
-	if (!(tx_flags & I40E_TX_FLAGS_VXLAN_TUNNEL))
+	if (!(tx_flags & I40E_TX_FLAGS_UDP_TUNNEL))
 		dtype_cmd |=
 			((u32)I40E_FD_ATR_STAT_IDX(pf->hw.pf_id) <<
 			I40E_TXD_FLTR_QW1_CNTINDEX_SHIFT) &
@@ -2323,7 +2323,7 @@ static void i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,
 			oudph = udp_hdr(skb);
 			oiph = ip_hdr(skb);
 			l4_tunnel = I40E_TXD_CTX_UDP_TUNNELING;
-			*tx_flags |= I40E_TX_FLAGS_VXLAN_TUNNEL;
+			*tx_flags |= I40E_TX_FLAGS_UDP_TUNNEL;
 			break;
 		default:
 			return;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h
index a992cb8f..db2130f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h
@@ -151,7 +151,7 @@ enum i40e_dyn_idx_t {
 #define I40E_TX_FLAGS_FSO		BIT(7)
 #define I40E_TX_FLAGS_TSYN		BIT(8)
 #define I40E_TX_FLAGS_FD_SB		BIT(9)
-#define I40E_TX_FLAGS_VXLAN_TUNNEL	BIT(10)
+#define I40E_TX_FLAGS_UDP_TUNNEL	BIT(10)
 #define I40E_TX_FLAGS_VLAN_MASK		0xffff0000
 #define I40E_TX_FLAGS_VLAN_PRIO_MASK	0xe0000000
 #define I40E_TX_FLAGS_VLAN_PRIO_SHIFT	29
-- 
1.8.1.4


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

* [Intel-wired-lan] [PATCH 4/4] i40e: geneve tunnel offload support
  2015-08-20 18:46 [Intel-wired-lan] [PATCH 1/4] i40e: Remove CONFIG_I40E_VXLAN Anjali Singhai Jain
  2015-08-20 18:46 ` [Intel-wired-lan] [PATCH 2/4] geneve: Add geneve udp port offload for ethernet devices Anjali Singhai Jain
  2015-08-20 18:46 ` [Intel-wired-lan] [PATCH 3/4] i40e: Generalize the UDP tunnel offload flow Anjali Singhai Jain
@ 2015-08-20 18:46 ` Anjali Singhai Jain
  2015-08-21 22:55   ` Bowers, AndrewX
  2015-08-22  0:38   ` Jesse Gross
  2015-08-20 20:30 ` [Intel-wired-lan] [PATCH 1/4] i40e: Remove CONFIG_I40E_VXLAN Keller, Jacob E
  2015-08-26 23:45 ` Bowers, AndrewX
  4 siblings, 2 replies; 15+ messages in thread
From: Anjali Singhai Jain @ 2015-08-20 18:46 UTC (permalink / raw)
  To: intel-wired-lan

This patch adds driver hooks to implement ndo_ops to add/del udp
port in the HW to identify GENEVE tunnels.

Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Kiran Patil <kiran.patil@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e.h      |  1 +
 drivers/net/ethernet/intel/i40e/i40e_main.c | 89 ++++++++++++++++++++++++++++-
 drivers/net/ethernet/intel/i40e/i40e_txrx.c |  2 +-
 3 files changed, 89 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 71752c6..12c96da 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -330,6 +330,7 @@ struct i40e_pf {
 #define I40E_FLAG_VEB_STATS_ENABLED		BIT_ULL(37)
 #define I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE	BIT_ULL(38)
 #define I40E_FLAG_VEB_MODE_ENABLED		BIT_ULL(40)
+#define I40E_FLAG_GENEVE_OFFLOAD_CAPABLE	BIT_ULL(41)
 
 	/* tracks features that get auto disabled by errors */
 	u64 auto_disable_flags;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index bbc704b..7b41e1a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -6665,7 +6665,7 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
  **/
 static void i40e_sync_udp_filters_subtask(struct i40e_pf *pf)
 {
-#if defined(CONFIG_VXLAN) || defined(CONFIG_VXLAN_MODULE)
+#if defined(CONFIG_VXLAN) || defined(CONFIG_VXLAN_MODULE) || defined(CONFIG_GENEVE_CORE)
 	struct i40e_hw *hw = &pf->hw;
 	i40e_status ret;
 	__be16 port;
@@ -7843,7 +7843,8 @@ static int i40e_sw_init(struct i40e_pf *pf)
 			     I40E_FLAG_HW_ATR_EVICT_CAPABLE |
 			     I40E_FLAG_OUTER_UDP_CSUM_CAPABLE |
 			     I40E_FLAG_WB_ON_ITR_CAPABLE |
-			     I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE;
+			     I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE |
+			     I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
 	}
 	pf->eeprom_version = 0xDEAD;
 	pf->lan_veb = I40E_NO_VEB;
@@ -8036,6 +8037,88 @@ static void i40e_del_vxlan_port(struct net_device *netdev,
 	}
 }
 
+/**
+ * i40e_add_geneve_port - Get notifications about GENEVE ports that come up
+ * @netdev: This physical port's netdev
+ * @sa_family: Socket Family that GENEVE is notifying us about
+ * @port: New UDP port number that GENEVE started listening to
+ **/
+static void i40e_add_geneve_port(struct net_device *netdev,
+				 sa_family_t sa_family, __be16 port)
+{
+	struct i40e_netdev_priv *np = netdev_priv(netdev);
+	struct i40e_vsi *vsi = np->vsi;
+	struct i40e_pf *pf = vsi->back;
+	u8 next_idx;
+	u8 idx;
+
+	if (!(pf->flags & I40E_FLAG_GENEVE_OFFLOAD_CAPABLE))
+		return;
+
+	if (sa_family == AF_INET6)
+		return;
+
+	idx = i40e_get_udp_port_idx(pf, port);
+
+	/* Check if port already exists */
+	if (idx < I40E_MAX_PF_UDP_OFFLOAD_PORTS) {
+		netdev_info(netdev, "udp port %d already offloaded\n",
+			    ntohs(port));
+		return;
+	}
+
+	/* Now check if there is space to add the new port */
+	next_idx = i40e_get_udp_port_idx(pf, 0);
+
+	if (next_idx == I40E_MAX_PF_UDP_OFFLOAD_PORTS) {
+		netdev_info(netdev, "maximum number of UDP ports reached, not adding port %d\n",
+			    ntohs(port));
+		return;
+	}
+
+	/* New port: add it and mark its index in the bitmap */
+	pf->udp_ports[next_idx].index = port;
+	pf->udp_ports[next_idx].type = I40E_AQC_TUNNEL_TYPE_NGE;
+	pf->pending_udp_bitmap |= BIT_ULL(next_idx);
+	pf->flags |= I40E_FLAG_UDP_FILTER_SYNC;
+}
+
+/**
+ * i40e_del_geneve_port - Get notifications about GENEVE ports that go away
+ * @netdev: This physical port's netdev
+ * @sa_family: Socket Family that GENEVE is notifying us about
+ * @port: UDP port number that GENEVE stopped listening to
+ **/
+static void i40e_del_geneve_port(struct net_device *netdev,
+				 sa_family_t sa_family, __be16 port)
+{
+	struct i40e_netdev_priv *np = netdev_priv(netdev);
+	struct i40e_vsi *vsi = np->vsi;
+	struct i40e_pf *pf = vsi->back;
+	u8 idx;
+
+	if (!(pf->flags & I40E_FLAG_GENEVE_OFFLOAD_CAPABLE))
+		return;
+
+	if (sa_family == AF_INET6)
+		return;
+
+	idx = i40e_get_udp_port_idx(pf, port);
+
+	/* Check if port already exists */
+	if (idx < I40E_MAX_PF_UDP_OFFLOAD_PORTS) {
+		/* if port exists, set it to 0 (mark for deletion)
+		 * and make it pending
+		 */
+		pf->udp_ports[idx].index = 0;
+		pf->pending_udp_bitmap |= BIT_ULL(idx);
+		pf->flags |= I40E_FLAG_UDP_FILTER_SYNC;
+	} else {
+		netdev_warn(netdev, "geneve port %d was not found, not deleting\n",
+			    ntohs(port));
+	}
+}
+
 static int i40e_get_phys_port_id(struct net_device *netdev,
 				 struct netdev_phys_item_id *ppid)
 {
@@ -8260,6 +8343,8 @@ static const struct net_device_ops i40e_netdev_ops = {
 	.ndo_set_vf_spoofchk	= i40e_ndo_set_vf_spoofchk,
 	.ndo_add_vxlan_port	= i40e_add_vxlan_port,
 	.ndo_del_vxlan_port	= i40e_del_vxlan_port,
+	.ndo_add_geneve_port	= i40e_add_geneve_port,
+	.ndo_del_geneve_port	= i40e_del_geneve_port,
 	.ndo_get_phys_port_id	= i40e_get_phys_port_id,
 	.ndo_fdb_add		= i40e_ndo_fdb_add,
 	.ndo_features_check	= i40e_features_check,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 424c5cc..b93c2dc 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1425,7 +1425,7 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi,
 	if (rx_error & BIT(I40E_RX_DESC_ERROR_PPRS_SHIFT))
 		return;
 
-	/* If VXLAN traffic has an outer UDPv4 checksum we need to check
+	/* If VXLAN/GENEVE traffic has an outer UDPv4 checksum we need to check
 	 * it in the driver, hardware does not do it for us.
 	 * Since L3L4P bit was set we assume a valid IHL value (>=5)
 	 * so the total length of IPv4 header is IHL*4 bytes
-- 
1.8.1.4


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

* [Intel-wired-lan] [PATCH 1/4] i40e: Remove CONFIG_I40E_VXLAN
  2015-08-20 18:46 [Intel-wired-lan] [PATCH 1/4] i40e: Remove CONFIG_I40E_VXLAN Anjali Singhai Jain
                   ` (2 preceding siblings ...)
  2015-08-20 18:46 ` [Intel-wired-lan] [PATCH 4/4] i40e: geneve tunnel offload support Anjali Singhai Jain
@ 2015-08-20 20:30 ` Keller, Jacob E
  2015-08-26 23:45 ` Bowers, AndrewX
  4 siblings, 0 replies; 15+ messages in thread
From: Keller, Jacob E @ 2015-08-20 20:30 UTC (permalink / raw)
  To: intel-wired-lan

On Thu, 2015-08-20 at 11:46 -0700, Anjali Singhai Jain wrote:
> If the kernel flag CONFIG_VXLAN is true or CONFIG_VXLAN_MODULE is
> true,
> enable VXLAN offload in the driver.
> 
> Signed-off-by: Kiran Patil <kiran.patil@intel.com>
> Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
> ---
>  drivers/net/ethernet/intel/Kconfig          | 11 -----------
>  drivers/net/ethernet/intel/i40e/i40e.h      |  4 ----
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 14 ++++----------
>  3 files changed, 4 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/Kconfig
> b/drivers/net/ethernet/intel/Kconfig
> index 4163b16..061e4e0 100644
> --- a/drivers/net/ethernet/intel/Kconfig
> +++ b/drivers/net/ethernet/intel/Kconfig
> @@ -269,17 +269,6 @@ config I40E
>  	  To compile this driver as a module, choose M here. The
> module
>  	  will be called i40e.
>  
> -config I40E_VXLAN
> -	bool "Virtual eXtensible Local Area Network Support"
> -	default n
> -	depends on I40E && VXLAN && !(I40E=y && VXLAN=m)
> -	---help---
> -	  This allows one to create VXLAN virtual interfaces that
> provide
> -	  Layer 2 Networks over Layer 3 Networks. VXLAN is often
> used
> -	  to tunnel virtual network infrastructure in virtualized
> environments.
> -	  Say Y here if you want to use Virtual eXtensible Local
> Area Network
> -	  (VXLAN) in the driver.
> -
>  config I40E_DCB
>  	bool "Data Center Bridging (DCB) Support"
>  	default n
> diff --git a/drivers/net/ethernet/intel/i40e/i40e.h
> b/drivers/net/ethernet/intel/i40e/i40e.h
> index c9fa289..257f7d8 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e.h
> +++ b/drivers/net/ethernet/intel/i40e/i40e.h
> @@ -274,11 +274,9 @@ struct i40e_pf {
>  	u32 fd_atr_cnt;
>  	u32 fd_tcp_rule;
>  
> -#ifdef CONFIG_I40E_VXLAN
>  	__be16  vxlan_ports[I40E_MAX_PF_UDP_OFFLOAD_PORTS];
>  	u16 pending_vxlan_bitmap;
>  
> -#endif
>  	enum i40e_interrupt_policy int_policy;
>  	u16 rx_itr_default;
>  	u16 tx_itr_default;
> @@ -316,9 +314,7 @@ struct i40e_pf {
>  #define I40E_FLAG_FD_ATR_ENABLED		BIT_ULL(22)
>  #define I40E_FLAG_PTP				BIT_ULL(25)
>  #define I40E_FLAG_MFP_ENABLED			BIT_ULL(26)
> -#ifdef CONFIG_I40E_VXLAN
>  #define I40E_FLAG_VXLAN_FILTER_SYNC		BIT_ULL(27)
> -#endif
>  #define I40E_FLAG_PORT_ID_VALID			BIT_ULL(28)
>  #define I40E_FLAG_DCB_CAPABLE			BIT_ULL(29)
>  #define I40E_FLAG_RSS_AQ_CAPABLE		BIT_ULL(31)
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c
> b/drivers/net/ethernet/intel/i40e/i40e_main.c
> index aef0a4c..05081d1 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -28,7 +28,7 @@
>  #include "i40e.h"
>  #include "i40e_helper.h"
>  #include "i40e_diag.h"
> -#ifdef CONFIG_I40E_VXLAN
> +#if defined(CONFIG_VXLAN) || defined(CONFIG_VXLAN_MODULE)
> 

Use the following idiom instead for modules.

#if IS_ENABLED(CONFIG_VXLAN)


>  #include <net/vxlan.h>
>  #endif
>  
> @@ -4934,7 +4934,7 @@ int i40e_open(struct net_device *netdev)
>  						       TCP_FLAG_CWR)
> >> 16);
>  	wr32(&pf->hw, I40E_GLLAN_TSOMSK_L, be32_to_cpu(TCP_FLAG_CWR)
> >> 16);
>  
> -#ifdef CONFIG_I40E_VXLAN
> +#if defined(CONFIG_VXLAN) || defined(CONFIG_VXLAN_MODULE)
>  	vxlan_get_rx_port(netdev);
>  #endif
>  
> @@ -6659,13 +6659,13 @@ static void i40e_handle_mdd_event(struct
> i40e_pf *pf)
>  	i40e_flush(hw);
>  }
>  
> -#ifdef CONFIG_I40E_VXLAN
>  /**
>   * i40e_sync_vxlan_filters_subtask - Sync the VSI filter list with
> HW
>   * @pf: board private structure
>   **/
>  static void i40e_sync_vxlan_filters_subtask(struct i40e_pf *pf)
>  {
> +#if defined(CONFIG_VXLAN) || defined(CONFIG_VXLAN_MODULE)
>  	struct i40e_hw *hw = &pf->hw;
>  	i40e_status ret;
>  	__be16 port;
> @@ -6699,9 +6699,9 @@ static void
> i40e_sync_vxlan_filters_subtask(struct i40e_pf *pf)
>  			}
>  		}
>  	}
> +#endif
>  }
>  
> -#endif
>  /**
>   * i40e_service_task - Run the driver's async subtasks
>   * @work: pointer to work_struct containing our data
> @@ -6725,9 +6725,7 @@ static void i40e_service_task(struct
> work_struct *work)
>  	i40e_watchdog_subtask(pf);
>  	i40e_fdir_reinit_subtask(pf);
>  	i40e_sync_filters_subtask(pf);
> -#ifdef CONFIG_I40E_VXLAN
>  	i40e_sync_vxlan_filters_subtask(pf);
> -#endif
>  	i40e_clean_adminq_subtask(pf);
>  
>  	i40e_service_event_complete(pf);
> @@ -7944,7 +7942,6 @@ static int i40e_set_features(struct net_device
> *netdev,
>  	return 0;
>  }
>  
> -#ifdef CONFIG_I40E_VXLAN
>  /**
>   * i40e_get_vxlan_port_idx - Lookup a possibly offloaded for Rx UDP
> port
>   * @pf: board private structure
> @@ -8039,7 +8036,6 @@ static void i40e_del_vxlan_port(struct
> net_device *netdev,
>  	}
>  }
>  
> -#endif
>  static int i40e_get_phys_port_id(struct net_device *netdev,
>  				 struct netdev_phys_item_id *ppid)
>  {
> @@ -8262,10 +8258,8 @@ static const struct net_device_ops
> i40e_netdev_ops = {
>  	.ndo_get_vf_config	= i40e_ndo_get_vf_config,
>  	.ndo_set_vf_link_state	= i40e_ndo_set_vf_link_state,
>  	.ndo_set_vf_spoofchk	= i40e_ndo_set_vf_spoofchk,
> -#ifdef CONFIG_I40E_VXLAN
>  	.ndo_add_vxlan_port	= i40e_add_vxlan_port,
>  	.ndo_del_vxlan_port	= i40e_del_vxlan_port,
> -#endif
>  	.ndo_get_phys_port_id	= i40e_get_phys_port_id,
>  	.ndo_fdb_add		= i40e_ndo_fdb_add,
>  	.ndo_features_check	= i40e_features_check,

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

* [Intel-wired-lan] [PATCH 2/4] geneve: Add geneve udp port offload for ethernet devices
  2015-08-20 18:46 ` [Intel-wired-lan] [PATCH 2/4] geneve: Add geneve udp port offload for ethernet devices Anjali Singhai Jain
@ 2015-08-20 20:32   ` Keller, Jacob E
  2015-08-20 23:03     ` Singhai, Anjali
  2015-08-20 20:37   ` Keller, Jacob E
  1 sibling, 1 reply; 15+ messages in thread
From: Keller, Jacob E @ 2015-08-20 20:32 UTC (permalink / raw)
  To: intel-wired-lan

On Thu, 2015-08-20 at 11:46 -0700, Anjali Singhai Jain wrote:
> Add ndo_ops to add/del UDP ports to a device that supports geneve
> offload.
> 
> v2:Added comments for new ndo_ops and minor format fix.
> 
> Signed-off-by: Kiran Patil <kiran.patil@intel.com>
> Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
> ---
>  include/linux/netdevice.h | 20 +++++++++++++++++++-
>  net/ipv4/geneve_core.c    | 22 ++++++++++++++++++++++
>  2 files changed, 41 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index f3bb290..d6f00c7 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -1016,6 +1016,19 @@ typedef u16 (*select_queue_fallback_t)(struct
> net_device *dev,
>   *	address family that vxlan is not listening to anymore. The
> operation
>   *	is protected by the vxlan_net->sock_lock.
>   *
> + * void (*ndo_add_geneve_port)(struct net_device *dev,
> + *			      sa_family_t sa_family, __be16 port);
> + *	Called by geneve to notiy a driver about the UDP port and
> socket
> + *	address family that geneve is listnening to. It is called
> only when
> + *	a new port starts listening. The operation is protected by
> the
> + *	geneve_net->sock_lock.
> + *
> + * void (*ndo_del_geneve_port)(struct net_device *dev,
> + *			      sa_family_t sa_family, __be16 port);
> + *	Called by geneve to notify the driver about a UDP port and
> socket
> + *	address family that geneve is not listening to anymore.
> The operation
> + *	is protected by the geneve_net->sock_lock.
> + *


Would it make more sense to generalize the ndo op for future protocol
extension instead of continuing to add separate tunnel offload
functions for each one?


ie: generalize ndo_add_vxlan_port into "ndo_add_tunnel_port"?

Maybe it's not worth it though..?

Regards,
Jake

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

* [Intel-wired-lan] [PATCH 2/4] geneve: Add geneve udp port offload for ethernet devices
  2015-08-20 18:46 ` [Intel-wired-lan] [PATCH 2/4] geneve: Add geneve udp port offload for ethernet devices Anjali Singhai Jain
  2015-08-20 20:32   ` Keller, Jacob E
@ 2015-08-20 20:37   ` Keller, Jacob E
  2015-08-20 21:03     ` Singhai, Anjali
  1 sibling, 1 reply; 15+ messages in thread
From: Keller, Jacob E @ 2015-08-20 20:37 UTC (permalink / raw)
  To: intel-wired-lan

On Thu, 2015-08-20 at 11:46 -0700, Anjali Singhai Jain wrote:
> Add ndo_ops to add/del UDP ports to a device that supports geneve
> offload.
> 
> v2:Added comments for new ndo_ops and minor format fix.
> 
> Signed-off-by: Kiran Patil <kiran.patil@intel.com>
> Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
> ---

Am I missing something about how this would enable Tx offloads? Or is
that enabled already?

Regards,
Jake

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

* [Intel-wired-lan] [PATCH 2/4] geneve: Add geneve udp port offload for ethernet devices
  2015-08-20 20:37   ` Keller, Jacob E
@ 2015-08-20 21:03     ` Singhai, Anjali
  0 siblings, 0 replies; 15+ messages in thread
From: Singhai, Anjali @ 2015-08-20 21:03 UTC (permalink / raw)
  To: intel-wired-lan

This is in preparation for making the HW aware of which UDP ports are being used for Geneve packets so that it can do the Geneve offloads.
The TX/RX offload path is common between VXLAN and Geneve where in the skb is marked for encapsulation and the outer transport header determines
if it?s a UDP tunnel. 

Anjali
> -----Original Message-----
> From: Keller, Jacob E
> Sent: Thursday, August 20, 2015 1:37 PM
> To: intel-wired-lan at lists.osuosl.org; Singhai, Anjali
> Subject: Re: [Intel-wired-lan] [PATCH 2/4] geneve: Add geneve udp port
> offload for ethernet devices
> 
> On Thu, 2015-08-20 at 11:46 -0700, Anjali Singhai Jain wrote:
> > Add ndo_ops to add/del UDP ports to a device that supports geneve
> > offload.
> >
> > v2:Added comments for new ndo_ops and minor format fix.
> >
> > Signed-off-by: Kiran Patil <kiran.patil@intel.com>
> > Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
> > ---
> 
> Am I missing something about how this would enable Tx offloads? Or is that
> enabled already?
> 
> Regards,
> Jake

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

* [Intel-wired-lan] [PATCH 2/4] geneve: Add geneve udp port offload for ethernet devices
  2015-08-20 20:32   ` Keller, Jacob E
@ 2015-08-20 23:03     ` Singhai, Anjali
  2015-08-22  0:13       ` Jesse Gross
  0 siblings, 1 reply; 15+ messages in thread
From: Singhai, Anjali @ 2015-08-20 23:03 UTC (permalink / raw)
  To: intel-wired-lan



> -----Original Message-----
> From: Keller, Jacob E
> Sent: Thursday, August 20, 2015 1:32 PM
> To: intel-wired-lan at lists.osuosl.org; Singhai, Anjali
> Subject: Re: [Intel-wired-lan] [PATCH 2/4] geneve: Add geneve udp port
> offload for ethernet devices
> 
> On Thu, 2015-08-20 at 11:46 -0700, Anjali Singhai Jain wrote:
> > Add ndo_ops to add/del UDP ports to a device that supports geneve
> > offload.
> >
> > v2:Added comments for new ndo_ops and minor format fix.
> >
> > Signed-off-by: Kiran Patil <kiran.patil@intel.com>
> > Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
> > ---
> >  include/linux/netdevice.h | 20 +++++++++++++++++++-
> >  net/ipv4/geneve_core.c    | 22 ++++++++++++++++++++++
> >  2 files changed, 41 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> > index f3bb290..d6f00c7 100644
> > --- a/include/linux/netdevice.h
> > +++ b/include/linux/netdevice.h
> > @@ -1016,6 +1016,19 @@ typedef u16 (*select_queue_fallback_t)(struct
> > net_device *dev,
> >   *	address family that vxlan is not listening to anymore. The
> > operation
> >   *	is protected by the vxlan_net->sock_lock.
> >   *
> > + * void (*ndo_add_geneve_port)(struct net_device *dev,
> > + *			      sa_family_t sa_family, __be16 port);
> > + *	Called by geneve to notiy a driver about the UDP port and
> > socket
> > + *	address family that geneve is listnening to. It is called
> > only when
> > + *	a new port starts listening. The operation is protected by
> > the
> > + *	geneve_net->sock_lock.
> > + *
> > + * void (*ndo_del_geneve_port)(struct net_device *dev,
> > + *			      sa_family_t sa_family, __be16 port);
> > + *	Called by geneve to notify the driver about a UDP port and
> > socket
> > + *	address family that geneve is not listening to anymore.
> > The operation
> > + *	is protected by the geneve_net->sock_lock.
> > + *
> 
> 
> Would it make more sense to generalize the ndo op for future protocol
> extension instead of continuing to add separate tunnel offload functions for
> each one?
> 
> 
> ie: generalize ndo_add_vxlan_port into "ndo_add_tunnel_port"?
> 
> Maybe it's not worth it though..?
> 

Not worth it at this point,  should be done as a separate refactor patch involving cleaning up both vxlan and geneve modules plus all the drivers that use them.


> Regards,
> Jake

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

* [Intel-wired-lan] [PATCH 3/4] i40e: Generalize the UDP tunnel offload flow
  2015-08-20 18:46 ` [Intel-wired-lan] [PATCH 3/4] i40e: Generalize the UDP tunnel offload flow Anjali Singhai Jain
@ 2015-08-21 22:54   ` Bowers, AndrewX
  0 siblings, 0 replies; 15+ messages in thread
From: Bowers, AndrewX @ 2015-08-21 22:54 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Anjali Singhai Jain
> Sent: Thursday, August 20, 2015 11:46 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH 3/4] i40e: Generalize the UDP tunnel
> offload flow
> 
> This patch generalizes the implementation for UDP based tunnel offloads so
> that VXLAN and any other UDP based tunnel protocols such as Geneve can
> utilize it.
> 
> Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
> Signed-off-by: Kiran Patil <kiran.patil@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e.h      | 11 +++++--
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 50 ++++++++++++++----------
> -----  drivers/net/ethernet/intel/i40e/i40e_txrx.c |  6 ++--
> drivers/net/ethernet/intel/i40e/i40e_txrx.h |  2 +-
>  4 files changed, 37 insertions(+), 32 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>

Present in GIT log, code changes present in tree, does not break base driver

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

* [Intel-wired-lan] [PATCH 4/4] i40e: geneve tunnel offload support
  2015-08-20 18:46 ` [Intel-wired-lan] [PATCH 4/4] i40e: geneve tunnel offload support Anjali Singhai Jain
@ 2015-08-21 22:55   ` Bowers, AndrewX
  2015-08-22  0:38   ` Jesse Gross
  1 sibling, 0 replies; 15+ messages in thread
From: Bowers, AndrewX @ 2015-08-21 22:55 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Anjali Singhai Jain
> Sent: Thursday, August 20, 2015 11:46 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH 4/4] i40e: geneve tunnel offload support
> 
> This patch adds driver hooks to implement ndo_ops to add/del udp port in
> the HW to identify GENEVE tunnels.
> 
> Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
> Signed-off-by: Kiran Patil <kiran.patil@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e.h      |  1 +
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 89
> ++++++++++++++++++++++++++++-
> drivers/net/ethernet/intel/i40e/i40e_txrx.c |  2 +-
>  3 files changed, 89 insertions(+), 3 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Present in GIT log, code changes present in tree, does not break base driver

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

* [Intel-wired-lan] [PATCH 2/4] geneve: Add geneve udp port offload for ethernet devices
  2015-08-20 23:03     ` Singhai, Anjali
@ 2015-08-22  0:13       ` Jesse Gross
  2015-08-22  0:40         ` Singhai, Anjali
  0 siblings, 1 reply; 15+ messages in thread
From: Jesse Gross @ 2015-08-22  0:13 UTC (permalink / raw)
  To: intel-wired-lan

On Thu, Aug 20, 2015 at 4:03 PM, Singhai, Anjali
<anjali.singhai@intel.com> wrote:
>> -----Original Message-----
>> From: Keller, Jacob E
>> Sent: Thursday, August 20, 2015 1:32 PM
>> To: intel-wired-lan at lists.osuosl.org; Singhai, Anjali
>> Subject: Re: [Intel-wired-lan] [PATCH 2/4] geneve: Add geneve udp port
>> offload for ethernet devices
>>
>> On Thu, 2015-08-20 at 11:46 -0700, Anjali Singhai Jain wrote:
>> > Add ndo_ops to add/del UDP ports to a device that supports geneve
>> > offload.
>> >
>> > v2:Added comments for new ndo_ops and minor format fix.
>> >
>> > Signed-off-by: Kiran Patil <kiran.patil@intel.com>
>> > Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
>> > ---
>> >  include/linux/netdevice.h | 20 +++++++++++++++++++-
>> >  net/ipv4/geneve_core.c    | 22 ++++++++++++++++++++++
>> >  2 files changed, 41 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>> > index f3bb290..d6f00c7 100644
>> > --- a/include/linux/netdevice.h
>> > +++ b/include/linux/netdevice.h
>> > @@ -1016,6 +1016,19 @@ typedef u16 (*select_queue_fallback_t)(struct
>> > net_device *dev,
>> >   * address family that vxlan is not listening to anymore. The
>> > operation
>> >   * is protected by the vxlan_net->sock_lock.
>> >   *
>> > + * void (*ndo_add_geneve_port)(struct net_device *dev,
>> > + *                       sa_family_t sa_family, __be16 port);
>> > + * Called by geneve to notiy a driver about the UDP port and
>> > socket
>> > + * address family that geneve is listnening to. It is called
>> > only when
>> > + * a new port starts listening. The operation is protected by
>> > the
>> > + * geneve_net->sock_lock.
>> > + *
>> > + * void (*ndo_del_geneve_port)(struct net_device *dev,
>> > + *                       sa_family_t sa_family, __be16 port);
>> > + * Called by geneve to notify the driver about a UDP port and
>> > socket
>> > + * address family that geneve is not listening to anymore.
>> > The operation
>> > + * is protected by the geneve_net->sock_lock.
>> > + *
>>
>>
>> Would it make more sense to generalize the ndo op for future protocol
>> extension instead of continuing to add separate tunnel offload functions for
>> each one?
>>
>>
>> ie: generalize ndo_add_vxlan_port into "ndo_add_tunnel_port"?
>>
>> Maybe it's not worth it though..?
>>
>
> Not worth it at this point,  should be done as a separate refactor patch involving cleaning up both vxlan and geneve modules plus all the drivers that use them.

I would strongly recommend making this generalization now. This has
specifically come up this week at Linux Plumbers and there have been
more general discussions about making this generic in the past, so
you'll likely get push back without it.

I would also suggest trying to get this to the netdev mailing as soon
as possible, in case there are other comments on the core
infrastructure.

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

* [Intel-wired-lan] [PATCH 4/4] i40e: geneve tunnel offload support
  2015-08-20 18:46 ` [Intel-wired-lan] [PATCH 4/4] i40e: geneve tunnel offload support Anjali Singhai Jain
  2015-08-21 22:55   ` Bowers, AndrewX
@ 2015-08-22  0:38   ` Jesse Gross
  1 sibling, 0 replies; 15+ messages in thread
From: Jesse Gross @ 2015-08-22  0:38 UTC (permalink / raw)
  To: intel-wired-lan

On Thu, Aug 20, 2015 at 11:46 AM, Anjali Singhai Jain
<anjali.singhai@intel.com> wrote:
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
> index bbc704b..7b41e1a 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -6665,7 +6665,7 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
>   **/
>  static void i40e_sync_udp_filters_subtask(struct i40e_pf *pf)
>  {
> -#if defined(CONFIG_VXLAN) || defined(CONFIG_VXLAN_MODULE)
> +#if defined(CONFIG_VXLAN) || defined(CONFIG_VXLAN_MODULE) || defined(CONFIG_GENEVE_CORE)

Presumably this also needs CONFIG_GENEVE_CORE_MODULE (or use IS_ENABLED).

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

* [Intel-wired-lan] [PATCH 2/4] geneve: Add geneve udp port offload for ethernet devices
  2015-08-22  0:13       ` Jesse Gross
@ 2015-08-22  0:40         ` Singhai, Anjali
  0 siblings, 0 replies; 15+ messages in thread
From: Singhai, Anjali @ 2015-08-22  0:40 UTC (permalink / raw)
  To: intel-wired-lan



> -----Original Message-----
> From: Jesse Gross [mailto:jesse at nicira.com]
> Sent: Friday, August 21, 2015 5:14 PM
> To: Singhai, Anjali
> Cc: Keller, Jacob E; intel-wired-lan at lists.osuosl.org
> Subject: Re: [Intel-wired-lan] [PATCH 2/4] geneve: Add geneve udp port
> offload for ethernet devices
> 
> On Thu, Aug 20, 2015 at 4:03 PM, Singhai, Anjali
> <anjali.singhai@intel.com> wrote:
> >> -----Original Message-----
> >> From: Keller, Jacob E
> >> Sent: Thursday, August 20, 2015 1:32 PM
> >> To: intel-wired-lan at lists.osuosl.org; Singhai, Anjali
> >> Subject: Re: [Intel-wired-lan] [PATCH 2/4] geneve: Add geneve udp port
> >> offload for ethernet devices
> >>
> >> On Thu, 2015-08-20 at 11:46 -0700, Anjali Singhai Jain wrote:
> >> > Add ndo_ops to add/del UDP ports to a device that supports geneve
> >> > offload.
> >> >
> >> > v2:Added comments for new ndo_ops and minor format fix.
> >> >
> >> > Signed-off-by: Kiran Patil <kiran.patil@intel.com>
> >> > Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
> >> > ---
> >> >  include/linux/netdevice.h | 20 +++++++++++++++++++-
> >> >  net/ipv4/geneve_core.c    | 22 ++++++++++++++++++++++
> >> >  2 files changed, 41 insertions(+), 1 deletion(-)
> >> >
> >> > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> >> > index f3bb290..d6f00c7 100644
> >> > --- a/include/linux/netdevice.h
> >> > +++ b/include/linux/netdevice.h
> >> > @@ -1016,6 +1016,19 @@ typedef u16
> (*select_queue_fallback_t)(struct
> >> > net_device *dev,
> >> >   * address family that vxlan is not listening to anymore. The
> >> > operation
> >> >   * is protected by the vxlan_net->sock_lock.
> >> >   *
> >> > + * void (*ndo_add_geneve_port)(struct net_device *dev,
> >> > + *                       sa_family_t sa_family, __be16 port);
> >> > + * Called by geneve to notiy a driver about the UDP port and
> >> > socket
> >> > + * address family that geneve is listnening to. It is called
> >> > only when
> >> > + * a new port starts listening. The operation is protected by
> >> > the
> >> > + * geneve_net->sock_lock.
> >> > + *
> >> > + * void (*ndo_del_geneve_port)(struct net_device *dev,
> >> > + *                       sa_family_t sa_family, __be16 port);
> >> > + * Called by geneve to notify the driver about a UDP port and
> >> > socket
> >> > + * address family that geneve is not listening to anymore.
> >> > The operation
> >> > + * is protected by the geneve_net->sock_lock.
> >> > + *
> >>
> >>
> >> Would it make more sense to generalize the ndo op for future protocol
> >> extension instead of continuing to add separate tunnel offload functions
> for
> >> each one?
> >>
> >>
> >> ie: generalize ndo_add_vxlan_port into "ndo_add_tunnel_port"?
> >>
> >> Maybe it's not worth it though..?
> >>
> >
> > Not worth it at this point,  should be done as a separate refactor patch
> involving cleaning up both vxlan and geneve modules plus all the drivers that
> use them.
> 
> I would strongly recommend making this generalization now. This has
> specifically come up this week at Linux Plumbers and there have been
> more general discussions about making this generic in the past, so
> you'll likely get push back without it.
> 
> I would also suggest trying to get this to the netdev mailing as soon
> as possible, in case there are other comments on the core
> infrastructure.

Ok, I will re-spin with a generic api, although I would be just compile testing the other drivers with the new api that use the present vxlan interface.
Hope that would suffice.

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

* [Intel-wired-lan] [PATCH 1/4] i40e: Remove CONFIG_I40E_VXLAN
  2015-08-20 18:46 [Intel-wired-lan] [PATCH 1/4] i40e: Remove CONFIG_I40E_VXLAN Anjali Singhai Jain
                   ` (3 preceding siblings ...)
  2015-08-20 20:30 ` [Intel-wired-lan] [PATCH 1/4] i40e: Remove CONFIG_I40E_VXLAN Keller, Jacob E
@ 2015-08-26 23:45 ` Bowers, AndrewX
  4 siblings, 0 replies; 15+ messages in thread
From: Bowers, AndrewX @ 2015-08-26 23:45 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Anjali Singhai Jain
> Sent: Thursday, August 20, 2015 11:46 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH 1/4] i40e: Remove CONFIG_I40E_VXLAN
> 
> If the kernel flag CONFIG_VXLAN is true or CONFIG_VXLAN_MODULE is true,
> enable VXLAN offload in the driver.
> 
> Signed-off-by: Kiran Patil <kiran.patil@intel.com>
> Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
> ---
>  drivers/net/ethernet/intel/Kconfig          | 11 -----------
>  drivers/net/ethernet/intel/i40e/i40e.h      |  4 ----
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 14 ++++----------
>  3 files changed, 4 insertions(+), 25 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Present in GIT log, code changes present in tree, will pass traffic when configured, traffic appears as expected in Wireshark.

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

end of thread, other threads:[~2015-08-26 23:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-20 18:46 [Intel-wired-lan] [PATCH 1/4] i40e: Remove CONFIG_I40E_VXLAN Anjali Singhai Jain
2015-08-20 18:46 ` [Intel-wired-lan] [PATCH 2/4] geneve: Add geneve udp port offload for ethernet devices Anjali Singhai Jain
2015-08-20 20:32   ` Keller, Jacob E
2015-08-20 23:03     ` Singhai, Anjali
2015-08-22  0:13       ` Jesse Gross
2015-08-22  0:40         ` Singhai, Anjali
2015-08-20 20:37   ` Keller, Jacob E
2015-08-20 21:03     ` Singhai, Anjali
2015-08-20 18:46 ` [Intel-wired-lan] [PATCH 3/4] i40e: Generalize the UDP tunnel offload flow Anjali Singhai Jain
2015-08-21 22:54   ` Bowers, AndrewX
2015-08-20 18:46 ` [Intel-wired-lan] [PATCH 4/4] i40e: geneve tunnel offload support Anjali Singhai Jain
2015-08-21 22:55   ` Bowers, AndrewX
2015-08-22  0:38   ` Jesse Gross
2015-08-20 20:30 ` [Intel-wired-lan] [PATCH 1/4] i40e: Remove CONFIG_I40E_VXLAN Keller, Jacob E
2015-08-26 23:45 ` Bowers, AndrewX

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.