i40e: Remove CONFIG_I40E_VXLAN
Subsystems (3)
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.
--- 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(-)
drivers/net/ethernet/intel/Kconfig +0 -11
@@ -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
drivers/net/ethernet/intel/i40e/i40e.h +0 -4
@@ -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)
drivers/net/ethernet/intel/i40e/i40e_main.c +4 -10
@@ -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,
Signature · 1 line
1.8.1.4
PATCH 2/4 geneve: Add geneve udp port offload for ethernet devices
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.
--- include/linux/netdevice.h | 20 +++++++++++++++++++- net/ipv4/geneve_core.c | 22 ++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-)
include/linux/netdevice.h +19 -1
@@ -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,
net/ipv4/geneve_core.c +22 -0
@@ -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);
Signature · 1 line
1.8.1.4
Keller
PATCH 2/4 geneve: Add geneve udp port offload for ethernet devices
Quoted 32 lines · Anjali Singhai Jain
Add
ndo_opsto add/del UDP ports to a device that supports geneve offload.v2:Added comments for new
ndo_opsand minor format fix.Signed-off-by Kiran Patil <[email protected]>Signed-off-by Anjali Singhai Jain <[email protected]>--- include/linux/netdevice.h | 20 +++++++++++++++++++- net/ipv4/geneve_core.c | 22 ++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-)include/linux/netdevice.h +0
-0@@ -1016,6 +1016,19 @@ typedef u16 (*select_queue_fallback_t)(structnet_device *dev, * address family that vxlan is not listening to anymore. Theoperation
* is protected by thevxlan_net->sock_lock.
*
+ * void (*ndo_add_geneve_port)(structnet_device*dev,
+ *sa_family_tsa_family,__be16port);
+ * 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.
+ *
Quoted 8 lines
+ * void (*ndo_del_geneve_port)(struct
net_device*dev,
+ *sa_family_tsa_family,__be16port);
+ * 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 thegeneve_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
Singhai
PATCH 2/4 geneve: Add geneve udp port offload for ethernet devices
Quoted 57 lines
-----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 devicesQuoted 32 lines · Anjali Singhai Jain
Add
ndo_opsto add/del UDP ports to a device that supports geneve offload.v2:Added comments for new
ndo_opsand minor format fix.Signed-off-by Kiran Patil <[email protected]>Signed-off-by Anjali Singhai Jain <[email protected]>--- include/linux/netdevice.h | 20 +++++++++++++++++++- net/ipv4/geneve_core.c | 22 ++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-)include/linux/netdevice.h +0
-0@@ -1016,6 +1016,19 @@ typedef u16 (*select_queue_fallback_t)(structnet_device *dev, * address family that vxlan is not listening to anymore. Theoperation
* is protected by thevxlan_net->sock_lock.
*
+ * void (*ndo_add_geneve_port)(structnet_device*dev,
+ *sa_family_tsa_family,__be16port);
+ * 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.
+ *Quoted 8 lines
+ * void (*ndo_del_geneve_port)(struct
net_device*dev,
+ *sa_family_tsa_family,__be16port);
+ * 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 thegeneve_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?
Quoted 4 lines
ie: generalize
ndo_add_vxlan_portinto "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.
Quoted 2 lines
Regards,
Jake
PATCH 2/4 geneve: Add geneve udp port offload for ethernet devices
Quoted 55 lines · Anjali
Quoted 55 lines
-----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 devicesQuoted 32 lines · Anjali Singhai Jain
Add
ndo_opsto add/del UDP ports to a device that supports geneve offload.v2:Added comments for new
ndo_opsand minor format fix.Signed-off-by Kiran Patil <[email protected]>Signed-off-by Anjali Singhai Jain <[email protected]>--- include/linux/netdevice.h | 20 +++++++++++++++++++- net/ipv4/geneve_core.c | 22 ++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-)include/linux/netdevice.h +0
-0@@ -1016,6 +1016,19 @@ typedef u16 (*select_queue_fallback_t)(structnet_device *dev, * address family that vxlan is not listening to anymore. Theoperation
* is protected by thevxlan_net->sock_lock.
*
+ * void (*ndo_add_geneve_port)(structnet_device*dev,
+ *sa_family_tsa_family,__be16port);
+ * 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.
+ *Quoted 8 lines
+ * void (*ndo_del_geneve_port)(struct
net_device*dev,
+ *sa_family_tsa_family,__be16port);
+ * 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 thegeneve_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?
Quoted 6 lines
Quoted 4 lines
ie: generalize
ndo_add_vxlan_portinto "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.
Singhai
PATCH 2/4 geneve: Add geneve udp port offload for ethernet devices
Quoted 78 lines
-----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 devicesQuoted 20 lines · Anjali
Quoted 20 lines
-----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 devicesQuoted 12 lines · Anjali Singhai Jain
Add
ndo_opsto add/del UDP ports to a device that supports geneve offload.v2:Added comments for new
ndo_opsand minor format fix.Signed-off-by Kiran Patil <[email protected]>Signed-off-by Anjali Singhai Jain <[email protected]>--- include/linux/netdevice.h | 20 +++++++++++++++++++- net/ipv4/geneve_core.c | 22 ++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-)Quoted 5 lines
Quoted 5 lines
include/linux/netdevice.h typedef u16
Quoted 5 lines
include/linux/netdevice.h +0
-0@@ -1016,6 +1016,19 @@ typedef u16(*select_queue_fallback_t)(struct
Quoted 25 lines
Quoted 25 lines
Quoted 23 lines
include/linux/netdevice.h +0
-0net_device *dev, * address family that vxlan is not listening to anymore. Theoperation
* is protected by thevxlan_net->sock_lock.
*
+ * void (*ndo_add_geneve_port)(structnet_device*dev,
+ *sa_family_tsa_family,__be16port);
+ * 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)(structnet_device*dev,
+ *sa_family_tsa_family,__be16port);
+ * 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 thegeneve_net->sock_lock.
+ *Quoted 2 lines
Quoted 2 lines
Would it make more sense to generalize the ndo op for future protocol extension instead of continuing to add separate tunnel offload functions
for
Quoted 9 lines
Quoted 7 lines
each one?
ie: generalize
ndo_add_vxlan_portinto "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.
Quoted 8 lines
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.
Keller
PATCH 2/4 geneve: Add geneve udp port offload for ethernet devices
In reply to Anjali Singhai JainQuoted 8 lines · Anjali Singhai Jain
Add
ndo_opsto add/del UDP ports to a device that supports geneve offload.v2:Added comments for new
ndo_opsand minor format fix.Signed-off-by Kiran Patil <[email protected]>Signed-off-by Anjali Singhai Jain <[email protected]>---
Am I missing something about how this would enable Tx offloads? Or is that enabled already?
Regards,
Jake
Singhai
PATCH 2/4 geneve: Add geneve udp port offload for ethernet devices
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
Quoted 22 lines
-----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 devicesQuoted 8 lines · Anjali Singhai Jain
Add
ndo_opsto add/del UDP ports to a device that supports geneve offload.v2:Added comments for new
ndo_opsand minor format fix.Signed-off-by Kiran Patil <[email protected]>Signed-off-by Anjali Singhai Jain <[email protected]>---
Am I missing something about how this would enable Tx offloads? Or is that enabled already?
Regards,
Jake
PATCH 3/4 i40e: Generalize the UDP tunnel offload flow
In reply to Anjali Singhai JainThis 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.
--- 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(-)
drivers/net/ethernet/intel/i40e/i40e.h +8 -3
@@ -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)
drivers/net/ethernet/intel/i40e/i40e_main.c +25 -25
129 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_txrx.c +3 -3
@@ -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 ;
drivers/net/ethernet/intel/i40e/i40e_txrx.h +1 -1
@@ -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
Signature · 1 line
1.8.1.4
Bowers
PATCH 3/4 i40e: Generalize the UDP tunnel offload flow
Quoted 12 lines
-----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 flowThis 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.
Quoted 8 lines
Signed-off-by Anjali Singhai Jain <[email protected]>Signed-off-by Kiran Patil <[email protected]>--- 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(-)
Present in GIT log, code changes present in tree, does not break base driver
PATCH 4/4 i40e: geneve tunnel offload support
In reply to Anjali Singhai JainThis patch adds driver hooks to implement ndo_ops to add/del udp port in the HW to identify GENEVE tunnels.
--- 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(-)
drivers/net/ethernet/intel/i40e/i40e.h +1 -0
@@ -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;
drivers/net/ethernet/intel/i40e/i40e_main.c +87 -2
113 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_txrx.c +1 -1
@@ -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
Signature · 1 line
1.8.1.4
Bowers
PATCH 4/4 i40e: geneve tunnel offload support
Quoted 10 lines
-----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 supportThis patch adds driver hooks to implement
ndo_opsto add/del udp port in the HW to identify GENEVE tunnels.
Quoted 8 lines
Signed-off-by Anjali Singhai Jain <[email protected]>Signed-off-by Kiran Patil <[email protected]>--- 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(-)
Present in GIT log, code changes present in tree, does not break base driver
PATCH 4/4 i40e: geneve tunnel offload support
In reply to Anjali Singhai Jaindrivers/net/ethernet/intel/i40e/i40e_main.c static void i40e_handle_mdd_event(struct i40e_pf *pf) · line 6668
Quoted 10 lines · Anjali Singhai Jain
drivers/net/ethernet/intel/i40e/i40e_main.c +1
-1@@ -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).
Keller
PATCH 1/4 i40e: Remove CONFIG_I40E_VXLAN
In reply to Anjali Singhai JainQuoted 73 lines · Anjali Singhai Jain
If the kernel flag
CONFIG_VXLANis true orCONFIG_VXLAN_MODULEis true,
enable VXLAN offload in the driver.Signed-off-by Kiran Patil <[email protected]>Signed-off-by Anjali Singhai Jain <[email protected]>--- 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(-)drivers/net/ethernet/intel/Kconfig +0
-0@@ -269,17 +269,6 @@ config I40E To compile this driver as a module, choose M here. Themodule
drivers/net/ethernet/intel/Kconfig +0
-6will 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 thatprovide
drivers/net/ethernet/intel/Kconfig +0
-1- Layer 2 Networks over Layer 3 Networks. VXLAN is oftenused
drivers/net/ethernet/intel/Kconfig +0
-1- to tunnel virtual network infrastructure in virtualizedenvironments.
drivers/net/ethernet/intel/Kconfig +0
-1- Say Y here if you want to use Virtual eXtensible LocalArea Network
drivers/net/ethernet/intel/Kconfig +0
-2- (VXLAN) in the driver. - config I40E_DCB bool "Data Center Bridging (DCB) Support" default ndrivers/net/ethernet/intel/i40e/i40e.h +0
-4@@ -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)drivers/net/ethernet/intel/i40e/i40e_main.c +0
-0
drivers/net/ethernet/intel/i40e/i40e_main.c line 32
Quoted 6 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +1
-1@@ -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)
Quoted 85 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +1
-1#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
drivers/net/ethernet/intel/i40e/i40e_main.c +0
-1@@ -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 voidi40e_sync_vxlan_filters_subtask(struct i40e_pf *pf){drivers/net/ethernet/intel/i40e/i40e_main.c +2
-1+#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_structcontaining our datadrivers/net/ethernet/intel/i40e/i40e_main.c +0
-2@@ -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);drivers/net/ethernet/intel/i40e/i40e_main.c +0
-1i40e_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 structuredrivers/net/ethernet/intel/i40e/i40e_main.c +0
-1@@ -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){
drivers/net/ethernet/intel/i40e/i40e_main.c +0
-2@@ -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,
Bowers
PATCH 1/4 i40e: Remove CONFIG_I40E_VXLAN
In reply to Anjali Singhai JainQuoted 10 lines
-----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: RemoveCONFIG_I40E_VXLANIf the kernel flag
CONFIG_VXLANis true orCONFIG_VXLAN_MODULEis true, enable VXLAN offload in the driver.
Quoted 7 lines
Signed-off-by Kiran Patil <[email protected]>Signed-off-by Anjali Singhai Jain <[email protected]>--- 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(-)
Present in GIT log, code changes present in tree, will pass traffic when configured, traffic appears as expected in Wireshark.