All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] netdevice.h: Fix unintentional disable of ALL_FOR_ALL features on upper device
@ 2020-11-23 14:12 Tariq Toukan
  2020-11-23 14:55 ` Eric Dumazet
  0 siblings, 1 reply; 9+ messages in thread
From: Tariq Toukan @ 2020-11-23 14:12 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Eric Dumazet, Herbert Xu
  Cc: netdev, Moshe Shemesh, Tariq Toukan, Maxim Mikityanskiy,
	Saeed Mahameed, Tariq Toukan

Calling netdev_increment_features() on upper/master device from
netdev_add_tso_features() implies unintentional clearance of ALL_FOR_ALL
features supported by all slaves.  Fix it by passing ALL_FOR_ALL in
addition to ALL_TSO.

Fixes: b0ce3508b25e ("bonding: allow TSO being set on bonding master")
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
 include/linux/netdevice.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Hi,

I know that netdev_increment_features() does not set any feature that's
unmasked in the mask argument.
I wonder why it can clear them though, was it meant to be like this?
If not, then the proper fix should be in netdev_increment_features(), not
in netdev_add_tso_features().


diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 18dec08439f9..a9d5e4bb829b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -4748,7 +4748,7 @@ netdev_features_t netdev_increment_features(netdev_features_t all,
 static inline netdev_features_t netdev_add_tso_features(netdev_features_t features,
 							netdev_features_t mask)
 {
-	return netdev_increment_features(features, NETIF_F_ALL_TSO, mask);
+	return netdev_increment_features(features, NETIF_F_ALL_TSO | NETIF_F_ALL_FOR_ALL, mask);
 }
 
 int __netdev_update_features(struct net_device *dev);
-- 
2.21.0


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

end of thread, other threads:[~2020-11-26 12:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-23 14:12 [PATCH net] netdevice.h: Fix unintentional disable of ALL_FOR_ALL features on upper device Tariq Toukan
2020-11-23 14:55 ` Eric Dumazet
2020-11-23 16:15   ` Tariq Toukan
2020-11-24 10:48     ` Eric Dumazet
2020-11-24 14:30       ` Tariq Toukan
2020-11-25  3:25       ` Herbert Xu
2020-11-25  9:06         ` Tariq Toukan
2020-11-25  9:27           ` Eric Dumazet
2020-11-26 12:01             ` Tariq Toukan

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.