* NETIF_F_TSO vs NETIF_F_TSO{6,_ECN}
@ 2011-04-05 15:50 Ben Hutchings
2011-04-05 18:03 ` Michał Mirosław
0 siblings, 1 reply; 4+ messages in thread
From: Ben Hutchings @ 2011-04-05 15:50 UTC (permalink / raw)
To: Michał Mirosław; +Cc: netdev
According to the commit that introduced NETIF_F_TSO6
(f83ef8c0b58dac17211a4c0b6df0e2b1bd6637b1):
This patch will introduce a new flag NETIF_F_TSO6 which will be used
to check whether device supports TSO over IPv6. If device support TSO
over IPv6 then we don't clear of NETIF_F_TSO and which will make the
TCP layer to create TSO packets. Any device supporting TSO over IPv6
will set NETIF_F_TSO6 flag in "dev->features" along with NETIF_F_TSO.
In case when user disables TSO using ethtool, NETIF_F_TSO will get
cleared from "dev->features". So even if we have NETIF_F_TSO6 we don't
get TSO packets created by TCP layer.
So I think we need to either:
1. Disallow toggling NETIF_F_TSO6 (following the previous rule)
2. Disable NETIF_F_TSO6 when NETIF_F_TSO is disabled
The same presumably applies to NETIF_F_TSO_ECN.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: NETIF_F_TSO vs NETIF_F_TSO{6,_ECN}
2011-04-05 15:50 NETIF_F_TSO vs NETIF_F_TSO{6,_ECN} Ben Hutchings
@ 2011-04-05 18:03 ` Michał Mirosław
2011-04-05 18:31 ` Ben Hutchings
0 siblings, 1 reply; 4+ messages in thread
From: Michał Mirosław @ 2011-04-05 18:03 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev
On Tue, Apr 05, 2011 at 04:50:02PM +0100, Ben Hutchings wrote:
> According to the commit that introduced NETIF_F_TSO6
> (f83ef8c0b58dac17211a4c0b6df0e2b1bd6637b1):
>
> This patch will introduce a new flag NETIF_F_TSO6 which will be used
> to check whether device supports TSO over IPv6. If device support TSO
> over IPv6 then we don't clear of NETIF_F_TSO and which will make the
> TCP layer to create TSO packets. Any device supporting TSO over IPv6
> will set NETIF_F_TSO6 flag in "dev->features" along with NETIF_F_TSO.
>
> In case when user disables TSO using ethtool, NETIF_F_TSO will get
> cleared from "dev->features". So even if we have NETIF_F_TSO6 we don't
> get TSO packets created by TCP layer.
>
> So I think we need to either:
> 1. Disallow toggling NETIF_F_TSO6 (following the previous rule)
> 2. Disable NETIF_F_TSO6 when NETIF_F_TSO is disabled
>
> The same presumably applies to NETIF_F_TSO_ECN.
There seems to be no such dependency in the networking code. I.e. TSO6
should just work with TSO4 disabled.
Best Regards,
Michał Mirosław
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: NETIF_F_TSO vs NETIF_F_TSO{6,_ECN}
2011-04-05 18:03 ` Michał Mirosław
@ 2011-04-05 18:31 ` Ben Hutchings
2011-04-06 21:22 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Ben Hutchings @ 2011-04-05 18:31 UTC (permalink / raw)
To: Michał Mirosław; +Cc: netdev, Herbert Xu
On Tue, 2011-04-05 at 20:03 +0200, Michał Mirosław wrote:
> On Tue, Apr 05, 2011 at 04:50:02PM +0100, Ben Hutchings wrote:
> > According to the commit that introduced NETIF_F_TSO6
> > (f83ef8c0b58dac17211a4c0b6df0e2b1bd6637b1):
> >
> > This patch will introduce a new flag NETIF_F_TSO6 which will be used
> > to check whether device supports TSO over IPv6. If device support TSO
> > over IPv6 then we don't clear of NETIF_F_TSO and which will make the
> > TCP layer to create TSO packets. Any device supporting TSO over IPv6
> > will set NETIF_F_TSO6 flag in "dev->features" along with NETIF_F_TSO.
> >
> > In case when user disables TSO using ethtool, NETIF_F_TSO will get
> > cleared from "dev->features". So even if we have NETIF_F_TSO6 we don't
> > get TSO packets created by TCP layer.
> >
> > So I think we need to either:
> > 1. Disallow toggling NETIF_F_TSO6 (following the previous rule)
> > 2. Disable NETIF_F_TSO6 when NETIF_F_TSO is disabled
> >
> > The same presumably applies to NETIF_F_TSO_ECN.
>
> There seems to be no such dependency in the networking code. I.e. TSO6
> should just work with TSO4 disabled.
*sigh* So it seems the commit message was wrong... and it should have
included a change like this:
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5203,9 +5203,9 @@ u32 netdev_fix_features(struct net_device *dev, u32 features)
}
/* TSO requires that SG is present as well. */
- if ((features & NETIF_F_TSO) && !(features & NETIF_F_SG)) {
- netdev_info(dev, "Dropping NETIF_F_TSO since no SG feature.\n");
- features &= ~NETIF_F_TSO;
+ if ((features & NETIF_F_ALL_TSO) && !(features & NETIF_F_SG)) {
+ netdev_info(dev, "Dropping TSO since no SG feature.\n");
+ features &= ~NETIF_F_ALL_TSO;
}
/* Software GSO depends on SG. */
---
Now that we're relying on these checks for dynamic changes to features,
this is pretty important.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-04-06 21:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-05 15:50 NETIF_F_TSO vs NETIF_F_TSO{6,_ECN} Ben Hutchings
2011-04-05 18:03 ` Michał Mirosław
2011-04-05 18:31 ` Ben Hutchings
2011-04-06 21:22 ` 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).