netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] bonding: move the netdev_add_tso_features() to bonding module
@ 2014-01-18  8:31 Ding Tianhong
  2014-01-18 11:48 ` Veaceslav Falico
  0 siblings, 1 reply; 4+ messages in thread
From: Ding Tianhong @ 2014-01-18  8:31 UTC (permalink / raw)
  To: Jay Vosburgh, Veaceslav Falico, Eric Dumazet, David S. Miller, Netdev

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.

Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
 drivers/net/bonding/bond_main.c | 12 +++++++++++-
 include/linux/netdevice.h       | 10 ----------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index e06c445..4cfe14e 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -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;
 }
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a2a70cc..1be74ea 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -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);
-- 
1.8.0

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

* Re: [PATCH net-next] bonding: move the netdev_add_tso_features() to bonding module
  2014-01-18  8:31 [PATCH net-next] bonding: move the netdev_add_tso_features() to bonding module Ding Tianhong
@ 2014-01-18 11:48 ` Veaceslav Falico
  2014-01-18 17:08   ` Eric Dumazet
  0 siblings, 1 reply; 4+ messages in thread
From: Veaceslav Falico @ 2014-01-18 11:48 UTC (permalink / raw)
  To: Ding Tianhong; +Cc: Jay Vosburgh, Eric Dumazet, David S. Miller, Netdev

On Sat, Jan 18, 2014 at 04:31:33PM +0800, Ding Tianhong wrote:
>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.

Eric added it for a reason - like, other drivers might use it. Do you know
if team, bridge, vlan etc. might use it?

Thanks.

>
>Cc: Eric Dumazet <edumazet@google.com>
>Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
>---
> drivers/net/bonding/bond_main.c | 12 +++++++++++-
> include/linux/netdevice.h       | 10 ----------
> 2 files changed, 11 insertions(+), 11 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index e06c445..4cfe14e 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -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;
> }
>diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>index a2a70cc..1be74ea 100644
>--- a/include/linux/netdevice.h
>+++ b/include/linux/netdevice.h
>@@ -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);
>-- 
>1.8.0
>
>

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

* Re: [PATCH net-next] bonding: move the netdev_add_tso_features() to bonding module
  2014-01-18 11:48 ` Veaceslav Falico
@ 2014-01-18 17:08   ` Eric Dumazet
  2014-01-19  5:34     ` Ding Tianhong
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2014-01-18 17:08 UTC (permalink / raw)
  To: Veaceslav Falico
  Cc: Ding Tianhong, Jay Vosburgh, Eric Dumazet, David S. Miller, Netdev

On Sat, 2014-01-18 at 12:48 +0100, Veaceslav Falico wrote:
> On Sat, Jan 18, 2014 at 04:31:33PM +0800, Ding Tianhong wrote:
> >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.
> 
> 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.

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

* Re: [PATCH net-next] bonding: move the netdev_add_tso_features() to bonding module
  2014-01-18 17:08   ` Eric Dumazet
@ 2014-01-19  5:34     ` Ding Tianhong
  0 siblings, 0 replies; 4+ messages in thread
From: Ding Tianhong @ 2014-01-19  5:34 UTC (permalink / raw)
  To: Eric Dumazet, Veaceslav Falico
  Cc: Jay Vosburgh, Eric Dumazet, David S. Miller, Netdev

On 2014/1/19 1:08, Eric Dumazet wrote:
> On Sat, 2014-01-18 at 12:48 +0100, Veaceslav Falico wrote:
>> On Sat, Jan 18, 2014 at 04:31:33PM +0800, Ding Tianhong wrote:
>>> 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.
>>
>> 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.
> 
> 

yep, it is look so fool that my patch said, thanks for reminding me.

> 
> 
> 

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

end of thread, other threads:[~2014-01-19  5:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-18  8:31 [PATCH net-next] bonding: move the netdev_add_tso_features() to bonding module Ding Tianhong
2014-01-18 11:48 ` Veaceslav Falico
2014-01-18 17:08   ` Eric Dumazet
2014-01-19  5:34     ` Ding Tianhong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).