netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] vlan: Add ability to always enable TSO/UFO
@ 2014-12-10  2:43 Toshiaki Makita
  2014-12-10  2:43 ` [PATCH net-next] bridge: " Toshiaki Makita
  2014-12-12 16:01 ` [PATCH net-next] vlan: " David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Toshiaki Makita @ 2014-12-10  2:43 UTC (permalink / raw)
  To: David S . Miller, Patrick McHardy; +Cc: Toshiaki Makita, netdev

Since the real device can segment packets by software, a vlan device
can set TSO/UFO even when the real device doesn't have those features.
Unlike GSO, this allows packets to be segmented after Qdisc.

Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
---
 net/8021q/vlan_dev.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 3768050..1189564 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -579,11 +579,12 @@ static int vlan_dev_init(struct net_device *dev)
 		      (1<<__LINK_STATE_PRESENT);
 
 	dev->hw_features = NETIF_F_ALL_CSUM | NETIF_F_SG |
-			   NETIF_F_FRAGLIST | NETIF_F_ALL_TSO |
+			   NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE |
 			   NETIF_F_HIGHDMA | NETIF_F_SCTP_CSUM |
 			   NETIF_F_ALL_FCOE;
 
-	dev->features |= real_dev->vlan_features | NETIF_F_LLTX;
+	dev->features |= real_dev->vlan_features | NETIF_F_LLTX |
+			 NETIF_F_GSO_SOFTWARE;
 	dev->gso_max_size = real_dev->gso_max_size;
 	if (dev->features & NETIF_F_VLAN_FEATURES)
 		netdev_warn(real_dev, "VLAN features are set incorrectly.  Q-in-Q configurations may not work correctly.\n");
@@ -648,7 +649,7 @@ static netdev_features_t vlan_dev_fix_features(struct net_device *dev,
 	features |= NETIF_F_RXCSUM;
 	features = netdev_intersect_features(features, real_dev->features);
 
-	features |= old_features & NETIF_F_SOFT_FEATURES;
+	features |= old_features & (NETIF_F_SOFT_FEATURES | NETIF_F_GSO_SOFTWARE);
 	features |= NETIF_F_LLTX;
 
 	return features;
-- 
1.8.1.2

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

* [PATCH net-next] bridge: Add ability to always enable TSO/UFO
  2014-12-10  2:43 [PATCH net-next] vlan: Add ability to always enable TSO/UFO Toshiaki Makita
@ 2014-12-10  2:43 ` Toshiaki Makita
  2014-12-10 19:50   ` David Miller
  2014-12-12 16:01 ` [PATCH net-next] vlan: " David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: Toshiaki Makita @ 2014-12-10  2:43 UTC (permalink / raw)
  To: David S . Miller, Stephen Hemminger; +Cc: netdev, bridge

Currently a bridge device turns off TSO/UFO features if no bridge ports
support it. We can always enable them, since packets can be segmented
on ports by software as well as on the bridge device.
This will reduce the number of packets processed in the bridge.

Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
---
 net/bridge/br_if.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index ed307db..e93bf17 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -418,7 +418,7 @@ netdev_features_t br_features_recompute(struct net_bridge *br,
 		return features;
 
 	mask = features;
-	features &= ~NETIF_F_ONE_FOR_ALL;
+	features &= ~NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE;
 
 	list_for_each_entry(p, &br->port_list, list) {
 		features = netdev_increment_features(features,
-- 
1.8.1.2

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

* Re: [PATCH net-next] bridge: Add ability to always enable TSO/UFO
  2014-12-10  2:43 ` [PATCH net-next] bridge: " Toshiaki Makita
@ 2014-12-10 19:50   ` David Miller
  2014-12-11  2:04     ` Toshiaki Makita
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2014-12-10 19:50 UTC (permalink / raw)
  To: makita.toshiaki; +Cc: netdev, bridge

From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Date: Wed, 10 Dec 2014 11:43:14 +0900

> -	features &= ~NETIF_F_ONE_FOR_ALL;
> +	features &= ~NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE;

I don't think this is the expression you intend to use.

I think you meant:

	features &= ~(NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE);

Or:

	features = ~NETIF_F_ONE_FOR_ALL;
	features |= NETIF_F_GSO_SOFTWARE;

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

* Re: [PATCH net-next] bridge: Add ability to always enable TSO/UFO
  2014-12-10 19:50   ` David Miller
@ 2014-12-11  2:04     ` Toshiaki Makita
  2014-12-11  2:13       ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Toshiaki Makita @ 2014-12-11  2:04 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, bridge

On 2014/12/11 4:50, David Miller wrote:
> From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
> Date: Wed, 10 Dec 2014 11:43:14 +0900
> 
>> -	features &= ~NETIF_F_ONE_FOR_ALL;
>> +	features &= ~NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE;
> 
> I don't think this is the expression you intend to use.

Thank you, but this is really my intended expression.

"features &= ~NETIF_F_ONE_FOR_ALL" drops all of ONE_FOR_ALL bits
including GSO_SOFTWARE.
But I want to leave GSO_SOFTWARE bits here.

> 
> I think you meant:
> 
> 	features &= ~(NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE);

ONE_FOR_ALL already includes GSO_SOFTWARE.

> 
> Or:
> 
> 	features = ~NETIF_F_ONE_FOR_ALL;
> 	features |= NETIF_F_GSO_SOFTWARE;

This way, users cannot drop TSO/UFO by ethtool.

Thanks,
Toshiaki Makita

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

* Re: [PATCH net-next] bridge: Add ability to always enable TSO/UFO
  2014-12-11  2:04     ` Toshiaki Makita
@ 2014-12-11  2:13       ` David Miller
  2014-12-11  2:20         ` Toshiaki Makita
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2014-12-11  2:13 UTC (permalink / raw)
  To: makita.toshiaki; +Cc: stephen, netdev, bridge

From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Date: Thu, 11 Dec 2014 11:04:44 +0900

> On 2014/12/11 4:50, David Miller wrote:
>> From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
>> Date: Wed, 10 Dec 2014 11:43:14 +0900
>> 
>>> -	features &= ~NETIF_F_ONE_FOR_ALL;
>>> +	features &= ~NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE;
>> 
>> I don't think this is the expression you intend to use.
> 
> Thank you, but this is really my intended expression.
> 
> "features &= ~NETIF_F_ONE_FOR_ALL" drops all of ONE_FOR_ALL bits
> including GSO_SOFTWARE.
> But I want to leave GSO_SOFTWARE bits here.

It is clearer to say this as:

	~(NETIF_F_ONE_FOR_ALL & ~NETIF_F_GSO_SOFTWARE)

Or create a new NETIF_F_* macro to express this idea succinctly.

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

* Re: [PATCH net-next] bridge: Add ability to always enable TSO/UFO
  2014-12-11  2:13       ` David Miller
@ 2014-12-11  2:20         ` Toshiaki Makita
  0 siblings, 0 replies; 7+ messages in thread
From: Toshiaki Makita @ 2014-12-11  2:20 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, bridge

On 2014/12/11 11:13, David Miller wrote:
> From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
> Date: Thu, 11 Dec 2014 11:04:44 +0900
> 
>> On 2014/12/11 4:50, David Miller wrote:
>>> From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
>>> Date: Wed, 10 Dec 2014 11:43:14 +0900
>>>
>>>> -	features &= ~NETIF_F_ONE_FOR_ALL;
>>>> +	features &= ~NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE;
>>>
>>> I don't think this is the expression you intend to use.
>>
>> Thank you, but this is really my intended expression.
>>
>> "features &= ~NETIF_F_ONE_FOR_ALL" drops all of ONE_FOR_ALL bits
>> including GSO_SOFTWARE.
>> But I want to leave GSO_SOFTWARE bits here.
> 
> It is clearer to say this as:
> 
> 	~(NETIF_F_ONE_FOR_ALL & ~NETIF_F_GSO_SOFTWARE)
> 
> Or create a new NETIF_F_* macro to express this idea succinctly.

OK, I will. (once net-next is reopened)

Thanks,
Toshiaki Makita

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

* Re: [PATCH net-next] vlan: Add ability to always enable TSO/UFO
  2014-12-10  2:43 [PATCH net-next] vlan: Add ability to always enable TSO/UFO Toshiaki Makita
  2014-12-10  2:43 ` [PATCH net-next] bridge: " Toshiaki Makita
@ 2014-12-12 16:01 ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2014-12-12 16:01 UTC (permalink / raw)
  To: makita.toshiaki; +Cc: kaber, netdev

From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Date: Wed, 10 Dec 2014 11:43:13 +0900

> Since the real device can segment packets by software, a vlan device
> can set TSO/UFO even when the real device doesn't have those features.
> Unlike GSO, this allows packets to be segmented after Qdisc.
> 
> Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>

Applied.

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

end of thread, other threads:[~2014-12-12 16:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-10  2:43 [PATCH net-next] vlan: Add ability to always enable TSO/UFO Toshiaki Makita
2014-12-10  2:43 ` [PATCH net-next] bridge: " Toshiaki Makita
2014-12-10 19:50   ` David Miller
2014-12-11  2:04     ` Toshiaki Makita
2014-12-11  2:13       ` David Miller
2014-12-11  2:20         ` Toshiaki Makita
2014-12-12 16:01 ` [PATCH net-next] vlan: " David Miller

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).