bonding: move the netdev_add_tso_features() to bonding module
Subsystems (3)
PATCH 1/1 bonding: move the netdev_add_tso_features() to bonding module
The function netdev_add_tso_features() was only be used for bonding, so no need to export it in netdevice.h, move it to bonding module.
--- drivers/net/bonding/bond_main.c | 12 +++++++++++- include/linux/netdevice.h | 10 ---------- 2 files changed, 11 insertions(+), 11 deletions(-)
drivers/net/bonding/bond_main.c +11 -1
@@ -1045,6 +1045,16 @@ static void bond_netpoll_cleanup(struct net_device *bond_dev)/*---------------------------------- IOCTL ----------------------------------*/ +/* Allow TSO being used on stacked device: +* Performing the GSO segmentation before last device +* is a performance improvement. +*/ +static netdev_features_t bond_add_tso_features (netdev_features_t features, +netdev_features_t mask) +{ +return netdev_increment_features (features,NETIF_F_ALL_TSO , mask); +} +static netdev_features_t bond_fix_features (struct net_device *dev,netdev_features_t features) {
@@ -1068,7 +1078,7 @@ static netdev_features_t bond_fix_features(struct net_device *dev, slave->dev->features, mask); } - features =netdev_add_tso_features (features, mask); + features =bond_add_tso_features (features, mask);return features; }
include/linux/netdevice.h +0 -10
@@ -3010,16 +3010,6 @@ static inline netdev_features_t netdev_get_wanted_features(netdev_features_t netdev_increment_features (netdev_features_t all,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);void netdev_update_features (struct net_device *dev);void netdev_change_features (struct net_device *dev);
Signature · 1 line
1.8.0
Quoted 2 lines · Ding Tianhong
The function
netdev_add_tso_features()was only be used for bonding, so no need to export it innetdevice.h, move it to bonding module.
Eric added it for a reason - like, other drivers might use it. Do you know if team, bridge, vlan etc. might use it?
Thanks.
Quoted 63 lines
Cc Eric Dumazet <[email protected]>Signed-off-by Ding Tianhong <[email protected]>---
drivers/net/bonding/bond_main.c| 12 +++++++++++-include/linux/netdevice.h| 10 ----------2 files changed, 11 insertions(+), 11 deletions(-)drivers/net/bonding/bond_main.c +11
-1@@ -1045,6 +1045,16 @@ static void bond_netpoll_cleanup(struct net_device *bond_dev)/*---------------------------------- IOCTL ----------------------------------*/ +/* Allow TSO being used on stacked device: +* Performing the GSO segmentation before last device +* is a performance improvement. +*/ +static netdev_features_t bond_add_tso_features (netdev_features_t features, +netdev_features_t mask) +{ +return netdev_increment_features (features,NETIF_F_ALL_TSO , mask); +} +static netdev_features_t bond_fix_features (struct net_device *dev,netdev_features_t features) {@@ -1068,7 +1078,7 @@ static netdev_features_t bond_fix_features(struct net_device *dev, slave->dev->features, mask); } - features =netdev_add_tso_features (features, mask); + features =bond_add_tso_features (features, mask);return features; }include/linux/netdevice.h +0
-10@@ -3010,16 +3010,6 @@ static inline netdev_features_t netdev_get_wanted_features(netdev_features_t netdev_increment_features (netdev_features_t all,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);void netdev_update_features (struct net_device *dev);void netdev_change_features (struct net_device *dev);Signature · 1 line
1.8.0
Quoted 6 lines · Veaceslav Falico
Quoted 2 lines · Ding Tianhong
The function
netdev_add_tso_features()was only be used for bonding, so no need to export it innetdevice.h, move it to bonding module.Eric added it for a reason - like, other drivers might use it. Do you know if team, bridge, vlan etc. might use it?
A helper can be used once, this is fine. A car can have 4 seats, and can even be used with no passenger.
I am quite bored by patches that break clean layering for wrong reasons.
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);
}There is _nothing_ in this helper that implies it should be private to bonding.
Quoted 14 lines · Eric Dumazet
Quoted 6 lines · Veaceslav Falico
Quoted 2 lines · Ding Tianhong
The function
netdev_add_tso_features()was only be used for bonding, so no need to export it innetdevice.h, move it to bonding module.Eric added it for a reason - like, other drivers might use it. Do you know if team, bridge, vlan etc. might use it?
A helper can be used once, this is fine. A car can have 4 seats, and can even be used with no passenger.
I am quite bored by patches that break clean layering for wrong reasons.
Quoted 9 lines
static inline
netdev_features_tnetdev_add_tso_features(netdev_features_t features,
netdev_features_tmask){ return netdev_increment_features(features, NETIF_F_ALL_TSO, mask); }There is _nothing_ in this helper that implies it should be private to bonding.
yep, it is look so fool that my patch said, thanks for reminding me.