diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2011-04-12 10:38:37 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-12 22:29:45 -0400 |
commit | ea2d36883ca8e6caab23b6d15bfa80b1d1d81d2f (patch) | |
tree | 38818d7330814e276b5e651ec4540ac2eb41d774 | |
parent | c0212fb146bf3e77cd6b28a06b8f503e2974fdc8 (diff) |
net: Disable all TSO features when SG is disabled
The feature flags NETIF_F_TSO and NETIF_F_TSO6 independently enable
TSO for IPv4 and IPv6 respectively. However, the test in
netdev_fix_features() and its predecessor functions was never updated
to check for NETIF_F_TSO6, possibly because it was originally proposed
that TSO for IPv6 would be dependent on both feature flags.
Now that these feature flags can be changed independently from
user-space and we depend on netdev_fix_features() to fix invalid
feature combinations, it's important to disable them both if
scatter-gather is disabled. Also disable NETIF_F_TSO_ECN so
user-space sees all TSO features as disabled.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/dev.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 956d3b006e8b..6401fb588145 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -5203,9 +5203,9 @@ u32 netdev_fix_features(struct net_device *dev, u32 features) | |||
5203 | } | 5203 | } |
5204 | 5204 | ||
5205 | /* TSO requires that SG is present as well. */ | 5205 | /* TSO requires that SG is present as well. */ |
5206 | if ((features & NETIF_F_TSO) && !(features & NETIF_F_SG)) { | 5206 | if ((features & NETIF_F_ALL_TSO) && !(features & NETIF_F_SG)) { |
5207 | netdev_info(dev, "Dropping NETIF_F_TSO since no SG feature.\n"); | 5207 | netdev_info(dev, "Dropping TSO features since no SG feature.\n"); |
5208 | features &= ~NETIF_F_TSO; | 5208 | features &= ~NETIF_F_ALL_TSO; |
5209 | } | 5209 | } |
5210 | 5210 | ||
5211 | /* Software GSO depends on SG. */ | 5211 | /* Software GSO depends on SG. */ |