netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roger Luethi <rl@hellgate.ch>
To: netdev@vger.kernel.org
Cc: mirqus@gmail.com
Subject: [PATCH] net: drop NETIF_F_GSO from hw_features without NETIF_F_SG
Date: Fri, 18 Mar 2011 20:50:30 +0100	[thread overview]
Message-ID: <20110318195030.GA22350@core.hellgate.ch> (raw)

register_netdevice() removes NETIF_F_GSO from dev->features and
dev->wanted_features for hardware without NETIF_F_SG to "avoid warning from
netdev_fix_features()".

However, as the flag remains set in dev->hw_features, users trying to
enable GSO via ethtool will still end up with NETIF_F_GSO stuck in
wanted_features, resulting in a warning every time they try to change any
feature (until they use ethtool to "disable" GSO):

# ethtool -K eth2 gso on
via-rhine 0000:03:00.0: eth2: Dropping NETIF_F_GSO since no SG feature.
# ethtool -K eth2 rx on
via-rhine 0000:03:00.0: eth2: Dropping NETIF_F_GSO since no SG feature.
via-rhine 0000:03:00.0: eth2: Features changed: 0x00004380 -> 0x20004380
# ethtool -K eth2 rx off
via-rhine 0000:03:00.0: eth2: Dropping NETIF_F_GSO since no SG feature.
via-rhine 0000:03:00.0: eth2: Features changed: 0x20004380 -> 0x00004380
# ethtool -K eth2 gso off
#

With NETIF_F_GSO depending on NETIF_F_SG, it seems we should not
advertise the former as a changeable option if the latter is missing.
---
 net/core/dev.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 0d39032..122d4ca 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5433,6 +5433,7 @@ int register_netdevice(struct net_device *dev)
 
 	/* Avoid warning from netdev_fix_features() for GSO without SG */
 	if (!(dev->wanted_features & NETIF_F_SG)) {
+		dev->hw_features &= ~NETIF_F_GSO;
 		dev->wanted_features &= ~NETIF_F_GSO;
 		dev->features &= ~NETIF_F_GSO;
 	}
-- 
1.7.3.4


             reply	other threads:[~2011-03-18 19:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-18 19:50 Roger Luethi [this message]
2011-03-18 20:43 ` [PATCH] net: drop NETIF_F_GSO from hw_features without NETIF_F_SG Michał Mirosław
2011-03-19  7:46   ` Roger Luethi
2011-03-19 16:18     ` Michał Mirosław
2011-03-20 18:56       ` Roger Luethi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110318195030.GA22350@core.hellgate.ch \
    --to=rl@hellgate.ch \
    --cc=mirqus@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).