This patchset adds a new netdevice feature to toggle tunnel offloads
via ethtool. This is useful if the offload is causing issues, for
example if the hardware is buggy.
The feature is added to all devices providing the ->ndo_udp_tunnel_add
op, and enabled by default to preserve current behavior.
When the administrator disables this feature on a device, all
currently offloaded ports are cleared from the device. When the
feature is turned on, the stack notifies the device about all current
ports.
Sabrina Dubroca (6):
net: add new netdevice feature for tunnel offloading
net: check tunnel offload feature before calling tunnel ndo ndo
net: add infrastructure to un-offload UDP tunnel port
net: call udp_tunnel_get_rx_info when NETIF_F_TUNNEL_OFFLOAD is
toggled
geneve/vxlan: add support for NETDEV_UDP_TUNNEL_DROP_INFO
geneve/vxlan: offload ports on register/unregister events
drivers/net/geneve.c | 24 ++++++++++++++++++------
drivers/net/vxlan.c | 31 ++++++++++++++++++++++---------
include/linux/netdev_features.h | 2 ++
include/linux/netdevice.h | 1 +
include/net/udp_tunnel.h | 8 ++++++++
net/core/dev.c | 28 +++++++++++++++++++++++++++-
net/core/ethtool.c | 1 +
net/ipv4/udp_tunnel.c | 25 ++++++++++++++++++++++++-
8 files changed, 103 insertions(+), 17 deletions(-)
--
2.13.2
This adds a new netdevice feature, so that tunnel offloading can be
disabled by the administrator on some netdevices, using the
"tunnel-offload" ethtool feature.
This feature is set for all devices that provide ndo_udp_tunnel_add.
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
include/linux/netdev_features.h | 2 ++
net/core/dev.c | 6 ++++++
net/core/ethtool.c | 1 +
3 files changed, 9 insertions(+)
If NETIF_F_TUNNEL_OFFLOAD was disabled on a given netdevice, skip the
tunnel offload ndo call during tunnel port creation and deletion.
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
net/ipv4/udp_tunnel.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
This adds a new NETDEV_UDP_TUNNEL_DROP_INFO event, similar to
NETDEV_UDP_TUNNEL_PUSH_INFO, to signal to un-offload ports.
This also adds udp_tunnel_drop_rx_port(), which calls
ndo_udp_tunnel_del.
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
include/linux/netdevice.h | 1 +
include/net/udp_tunnel.h | 8 ++++++++
net/ipv4/udp_tunnel.c | 18 ++++++++++++++++++
3 files changed, 27 insertions(+)
This improves consistency of handling when moving a netdev to another
netns. Most drivers currently do a full reset when the device goes up,
so that will flush the offload state anyway.
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
drivers/net/geneve.c | 7 ++++++-
drivers/net/vxlan.c | 10 +++++++---
2 files changed, 13 insertions(+), 4 deletions(-)
NETIF_F_TUNNEL_OFFLOAD is special, in that we need to do more than just
flip the bit in dev->features. When disabling we must also clear
currently offloaded ports from the device, and when enabling we must
tell the device to offload the ports it can.
Because vxlan stores its sockets in a hashtable and they are inserted
at the head of per-bucket lists, switching the feature off and then on
can result in a different set of ports being offloaded (depending on
the HW's limits).
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
net/core/dev.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
On Fri, 30 Jun 2017 15:19:45 +0200, Sabrina Dubroca wrote:
This adds a new netdevice feature, so that tunnel offloading can be
disabled by the administrator on some netdevices, using the
"tunnel-offload" ethtool feature.
This feature is set for all devices that provide ndo_udp_tunnel_add.
This patchset looks great, Sabrina! A few comments below.
On Fri, 30 Jun 2017 15:19:45 +0200, Sabrina Dubroca wrote:
quoted
This adds a new netdevice feature, so that tunnel offloading can be
disabled by the administrator on some netdevices, using the
"tunnel-offload" ethtool feature.
This feature is set for all devices that provide ndo_udp_tunnel_add.
This patchset looks great, Sabrina! A few comments below.
"Tunnel offload" is very broad. Could we be more specific, e.g. "RSS
tunnel offload" or such? NETIF_F_HW_TUNNEL_RSS?
Yeah, "tunnel offload" is too broad. But RSS isn't correct here, since
that's not the only thing that devices do with that feature.
Maybe "udp tunnel rx port" instead? Although, as Hannes pointed out
yesterday, we're not really sure that drivers/devices will only use it
for RX purposes either.
Yep, I'll update all that when we figure out a reasonable name.
Another thing I was thinking about would be to modify ethtool to show
these UDP tunneling features as a hierarchy (like we already have for
tx-checksumming). Both for this new feature and the existing
tx-udp_tnl-*.
Thanks for the comments,
--
Sabrina