All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] be2net: don't flip hw_features when VXLANs are added/deleted
@ 2018-10-03 13:20 Davide Caratti
  2018-10-05  7:59 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Davide Caratti @ 2018-10-03 13:20 UTC (permalink / raw)
  To: netdev, David S. Miller, Sriharsha Basavapatna, Ajit Khaparde,
	Sathya Perla
  Cc: Sabrina Dubroca

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>
---
 drivers/net/ethernet/emulex/benet/be_main.c | 5 +----
 1 file changed, 1 insertion(+), 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)
 	netdev->hw_enc_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
 				   NETIF_F_TSO | NETIF_F_TSO6 |
 				   NETIF_F_GSO_UDP_TUNNEL;
-	netdev->hw_features |= NETIF_F_GSO_UDP_TUNNEL;
-	netdev->features |= NETIF_F_GSO_UDP_TUNNEL;
 
 	dev_info(dev, "Enabled VxLAN offloads for UDP port %d\n",
 		 be16_to_cpu(port));
@@ -4025,8 +4023,6 @@ static void be_disable_vxlan_offloads(struct be_adapter *adapter)
 	adapter->vxlan_port = 0;
 
 	netdev->hw_enc_features = 0;
-	netdev->hw_features &= ~(NETIF_F_GSO_UDP_TUNNEL);
-	netdev->features &= ~(NETIF_F_GSO_UDP_TUNNEL);
 }
 
 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)
 	struct be_adapter *adapter = netdev_priv(netdev);
 
 	netdev->hw_features |= NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 |
+		NETIF_F_GSO_UDP_TUNNEL |
 		NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM |
 		NETIF_F_HW_VLAN_CTAG_TX;
 	if ((be_if_cap_flags(adapter) & BE_IF_FLAGS_RSS))
-- 
2.17.1

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

* Re: [PATCH net] be2net: don't flip hw_features when VXLANs are added/deleted
  2018-10-03 13:20 [PATCH net] be2net: don't flip hw_features when VXLANs are added/deleted Davide Caratti
@ 2018-10-05  7:59 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-10-05  7:59 UTC (permalink / raw)
  To: dcaratti; +Cc: netdev, sriharsha.basavapatna, ajit.khaparde, sathya.perla, sd

From: Davide Caratti <dcaratti@redhat.com>
Date: Wed,  3 Oct 2018 15:20:58 +0200

> 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>

Applied, thank you.

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

end of thread, other threads:[~2018-10-05 14:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-03 13:20 [PATCH net] be2net: don't flip hw_features when VXLANs are added/deleted Davide Caratti
2018-10-05  7:59 ` David Miller

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.