Commit b0ce3508 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

bonding: allow TSO being set on bonding master

In some situations, we need to disable TSO on bonding slaves.

bonding device automatically unset TSO in bond_fix_features(), and
performance is not good because :

1) We consume more cpu cycles.

2) GSO segmentation has some bugs leading to out of order TCP packets
if this segmentation is done before virtual device. This particular
problem will be addressed in a separate patch.

This patch allows TSO being set/unset on the bonding master,
so that GSO segmentation is done after bonding layer.

Signed-off-by: default avatarEric Dumazet <>
Cc: Michał Mirosław <>
Cc: Jay Vosburgh <>
Cc: Andy Gospodarek <>
Cc: Maciej Żenczykowski <>
Cc: Tom Herbert <>
Cc: Neal Cardwell <>
Cc: Yuchung Cheng <>
Signed-off-by: default avatarDavid S. Miller <>
parent 3aefe2b4
...@@ -1362,6 +1362,7 @@ static netdev_features_t bond_fix_features(struct net_device *dev, ...@@ -1362,6 +1362,7 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
slave->dev->features, slave->dev->features,
mask); mask);
} }
features = netdev_add_tso_features(features, mask);
out: out:
read_unlock(&bond->lock); read_unlock(&bond->lock);
...@@ -2733,6 +2733,17 @@ static inline netdev_features_t netdev_get_wanted_features( ...@@ -2733,6 +2733,17 @@ static inline netdev_features_t netdev_get_wanted_features(
} }
netdev_features_t netdev_increment_features(netdev_features_t all, netdev_features_t netdev_increment_features(netdev_features_t all,
netdev_features_t one, netdev_features_t mask); netdev_features_t one, netdev_features_t mask);
/* Allow TSO being used on stacked device :
* Performing the GSO segmentation before last device
* is a performance improvement.
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);
int __netdev_update_features(struct net_device *dev); int __netdev_update_features(struct net_device *dev);
void netdev_update_features(struct net_device *dev); void netdev_update_features(struct net_device *dev);
void netdev_change_features(struct net_device *dev); void netdev_change_features(struct net_device *dev);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment