The goal of netdev_add_tso_features() is to enable all TSO features but
it unintentionally loses NETIF_F_ALL_FOR_ALL features. This is because
the netdev_increment_features() it calls clears any NETIF_F_ALL_FOR_ALL
bits that aren't included in the incremental features and none of them
are included in NETIF_F_ALL_TSO. The behavior can be seen by enabling
tx-nocache-copy on the slaves and noticing the feature remains off at
the master.

Fix this by including NETIF_F_ALL_FOR_ALL in the incremental features.

Signed-off-by: Dave Platt <dpl...@google.com>
Signed-off-by: Dimitris Michailidis <dmich...@google.com>
---
 include/linux/netdevice.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c2f5112..da45388 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3978,7 +3978,12 @@ 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);
+       /* OR in NETIF_F_ALL_FOR_ALL to preserve any of its bits already present
+        * in features
+        */
+       return netdev_increment_features(features,
+                                        NETIF_F_ALL_TSO | NETIF_F_ALL_FOR_ALL,
+                                        mask);
 }
 
 int __netdev_update_features(struct net_device *dev);
-- 
2.8.0.rc3.226.g39d4020

Reply via email to