diff options
| author | Davide Caratti <dcaratti@redhat.com> | 2018-10-03 09:20:58 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2018-10-05 03:59:21 -0400 |
| commit | 2d52527e80c2dc0c5f43f50adf183781262ec565 (patch) | |
| tree | 9236400b15184a6d52116da13cdcd0dec1cda418 /drivers/net/ethernet/emulex | |
| parent | 9d2f67e43b73e8af7438be219b66a5de0cfa8bd9 (diff) | |
be2net: don't flip hw_features when VXLANs are added/deleted
the be2net implementation of .ndo_tunnel_{add,del}() changes the value of
NETIF_F_GSO_UDP_TUNNEL bit in 'features' and 'hw_features', but it forgets
to call netdev_features_change(). Moreover, ethtool setting for that bit
can potentially be reverted after a tunnel is added or removed.
GSO already does software segmentation when 'hw_enc_features' is 0, even
if VXLAN offload is turned on. In addition, commit 096de2f83ebc ("benet:
stricter vxlan offloading check in be_features_check") avoids hardware
segmentation of non-VXLAN tunneled packets, or VXLAN packets having wrong
destination port. So, it's safe to avoid flipping the above feature on
addition/deletion of VXLAN tunnels.
Fixes: 630f4b70567f ("be2net: Export tunnel offloads only when a VxLAN tunnel is created")
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex')
| -rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 74d122616e76..534787291b44 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
| @@ -4002,8 +4002,6 @@ static int be_enable_vxlan_offloads(struct be_adapter *adapter) | |||
| 4002 | netdev->hw_enc_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | | 4002 | netdev->hw_enc_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
| 4003 | NETIF_F_TSO | NETIF_F_TSO6 | | 4003 | NETIF_F_TSO | NETIF_F_TSO6 | |
| 4004 | NETIF_F_GSO_UDP_TUNNEL; | 4004 | NETIF_F_GSO_UDP_TUNNEL; |
| 4005 | netdev->hw_features |= NETIF_F_GSO_UDP_TUNNEL; | ||
| 4006 | netdev->features |= NETIF_F_GSO_UDP_TUNNEL; | ||
| 4007 | 4005 | ||
| 4008 | dev_info(dev, "Enabled VxLAN offloads for UDP port %d\n", | 4006 | dev_info(dev, "Enabled VxLAN offloads for UDP port %d\n", |
| 4009 | be16_to_cpu(port)); | 4007 | be16_to_cpu(port)); |
| @@ -4025,8 +4023,6 @@ static void be_disable_vxlan_offloads(struct be_adapter *adapter) | |||
| 4025 | adapter->vxlan_port = 0; | 4023 | adapter->vxlan_port = 0; |
| 4026 | 4024 | ||
| 4027 | netdev->hw_enc_features = 0; | 4025 | netdev->hw_enc_features = 0; |
| 4028 | netdev->hw_features &= ~(NETIF_F_GSO_UDP_TUNNEL); | ||
| 4029 | netdev->features &= ~(NETIF_F_GSO_UDP_TUNNEL); | ||
| 4030 | } | 4026 | } |
| 4031 | 4027 | ||
| 4032 | static void be_calculate_vf_res(struct be_adapter *adapter, u16 num_vfs, | 4028 | static void be_calculate_vf_res(struct be_adapter *adapter, u16 num_vfs, |
| @@ -5320,6 +5316,7 @@ static void be_netdev_init(struct net_device *netdev) | |||
| 5320 | struct be_adapter *adapter = netdev_priv(netdev); | 5316 | struct be_adapter *adapter = netdev_priv(netdev); |
| 5321 | 5317 | ||
| 5322 | netdev->hw_features |= NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 | | 5318 | netdev->hw_features |= NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 | |
| 5319 | NETIF_F_GSO_UDP_TUNNEL | | ||
| 5323 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM | | 5320 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM | |
| 5324 | NETIF_F_HW_VLAN_CTAG_TX; | 5321 | NETIF_F_HW_VLAN_CTAG_TX; |
| 5325 | if ((be_if_cap_flags(adapter) & BE_IF_FLAGS_RSS)) | 5322 | if ((be_if_cap_flags(adapter) & BE_IF_FLAGS_RSS)) |
