From: Roger Luethi <rl@hellgate.ch>
To: Micha? Miros?aw <mirqus@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] net: drop NETIF_F_GSO from hw_features without NETIF_F_SG
Date: Sun, 20 Mar 2011 19:56:54 +0100 [thread overview]
Message-ID: <20110320185654.GA14223@core.hellgate.ch> (raw)
In-Reply-To: <AANLkTinCdaEs=G=AC45ePA-J99Vik9fYE+ZyF1miCiVy@mail.gmail.com>
On Sat, 19 Mar 2011 17:18:17 +0100, Micha? Miros?aw wrote:
> > However, I still think the current, unpatched behavior is confusing users.
> > ethtool_get_features() will happily tell the user that GSO is available for
> > a NIC even if it is not (because the NIC does not support SG). Then, if the
> > user tries to enable GSO, the operation fails silently: ethtool won't get
> > an error code, so it looks as if the operation succeeded. The user needs to
> > look into the kernel log or actually verify the offload settings to realize
> > that something went wrong.
>
> Do you want to prepare a patch for this? Please remember about
> compatibility with per-offload ethtool ops if you do - this needs to
> be there until all drivers are converted to hw_features.
Something like this?
diff --git a/net/core/dev.c b/net/core/dev.c
index 0b88eba..5861a59 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5442,6 +5442,9 @@ int register_netdevice(struct net_device *dev)
if (!(dev->wanted_features & NETIF_F_SG)) {
dev->wanted_features &= ~NETIF_F_GSO;
dev->features &= ~NETIF_F_GSO;
+ if (!(dev->hw_features & NETIF_F_SG) &&
+ (!dev->ethtool_ops || !dev->ethtool_ops->set_sg))
+ dev->hw_features &= ~NETIF_F_GSO;
}
/* Enable GRO and NETIF_F_HIGHDMA for vlans by default,
prev parent reply other threads:[~2011-03-20 18:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-18 19:50 [PATCH] net: drop NETIF_F_GSO from hw_features without NETIF_F_SG Roger Luethi
2011-03-18 20:43 ` 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 [this message]
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=20110320185654.GA14223@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.