netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-2.6 1/2] net: Disable all TSO features when SG is disabled
@ 2011-04-13  0:38 Ben Hutchings
  2011-04-13  0:47 ` [PATCH net-2.6 2/2] net: Disable NETIF_F_TSO_ECN when TSO " Ben Hutchings
  2011-04-13  2:29 ` [PATCH net-2.6 1/2] net: Disable all TSO features when SG " David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Ben Hutchings @ 2011-04-13  0:38 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Michał Mirosław

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>
---
 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 956d3b0..6401fb5 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)
 	}
 
 	/* 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 features since no SG feature.\n");
+		features &= ~NETIF_F_ALL_TSO;
 	}
 
 	/* Software GSO depends on SG. */
-- 
1.7.4



-- 
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 related	[flat|nested] 4+ messages in thread

* [PATCH net-2.6 2/2] net: Disable NETIF_F_TSO_ECN when TSO is disabled
  2011-04-13  0:38 [PATCH net-2.6 1/2] net: Disable all TSO features when SG is disabled Ben Hutchings
@ 2011-04-13  0:47 ` Ben Hutchings
  2011-04-13  2:30   ` David Miller
  2011-04-13  2:29 ` [PATCH net-2.6 1/2] net: Disable all TSO features when SG " David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Ben Hutchings @ 2011-04-13  0:47 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Michał Mirosław

NETIF_F_TSO_ECN has no effect when TSO is disabled; this just means
that feature state will be accurately reported to user-space.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
This one is silent; I'm not sure that it's worth mentioning as the
feature flag previously had no effect on its own anyway.

Ben.

 net/core/dev.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 6401fb5..c2ac599 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5208,6 +5208,10 @@ u32 netdev_fix_features(struct net_device *dev, u32 features)
 		features &= ~NETIF_F_ALL_TSO;
 	}
 
+	/* TSO ECN requires that TSO is present as well. */
+	if ((features & NETIF_F_ALL_TSO) == NETIF_F_TSO_ECN)
+		features &= ~NETIF_F_TSO_ECN;
+
 	/* Software GSO depends on SG. */
 	if ((features & NETIF_F_GSO) && !(features & NETIF_F_SG)) {
 		netdev_info(dev, "Dropping NETIF_F_GSO since no SG feature.\n");
-- 
1.7.4


-- 
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 related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-2.6 1/2] net: Disable all TSO features when SG is disabled
  2011-04-13  0:38 [PATCH net-2.6 1/2] net: Disable all TSO features when SG is disabled Ben Hutchings
  2011-04-13  0:47 ` [PATCH net-2.6 2/2] net: Disable NETIF_F_TSO_ECN when TSO " Ben Hutchings
@ 2011-04-13  2:29 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2011-04-13  2:29 UTC (permalink / raw)
  To: bhutchings; +Cc: netdev, mirq-linux

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Wed, 13 Apr 2011 01:38:37 +0100

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

Applied.

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

* Re: [PATCH net-2.6 2/2] net: Disable NETIF_F_TSO_ECN when TSO is disabled
  2011-04-13  0:47 ` [PATCH net-2.6 2/2] net: Disable NETIF_F_TSO_ECN when TSO " Ben Hutchings
@ 2011-04-13  2:30   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2011-04-13  2:30 UTC (permalink / raw)
  To: bhutchings; +Cc: netdev, mirq-linux

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Wed, 13 Apr 2011 01:47:15 +0100

> NETIF_F_TSO_ECN has no effect when TSO is disabled; this just means
> that feature state will be accurately reported to user-space.
> 
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>

Applied.

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

end of thread, other threads:[~2011-04-13  2:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-13  0:38 [PATCH net-2.6 1/2] net: Disable all TSO features when SG is disabled Ben Hutchings
2011-04-13  0:47 ` [PATCH net-2.6 2/2] net: Disable NETIF_F_TSO_ECN when TSO " Ben Hutchings
2011-04-13  2:30   ` David Miller
2011-04-13  2:29 ` [PATCH net-2.6 1/2] net: Disable all TSO features when SG " 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).