From: Ben Hutchings <bhutchings@solarflare.com>
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] net: implement dev_disable_lro() hw_features compatibility
Date: Fri, 18 Mar 2011 18:13:06 +0000 [thread overview]
Message-ID: <1300471986.2589.26.camel@bwh-desktop> (raw)
In-Reply-To: <37d3c96bc52c87fcd4cdd39c9c852b1d2bbc249d.1300466356.git.mirq-linux@rere.qmqm.pl>
On Fri, 2011-03-18 at 18:42 +0100, Michał Mirosław wrote:
> Implement compatibility with new hw_features for dev_disable_lro().
Good point, but...
> This is a transition path - dev_disable_lro() should be later
> integrated into netdev_fix_features() after all drivers are converted.
>
> There's no point in exporting __ethtool_set_flags() as it and dev_disable_lro()
> are always built-in.
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---
>
> Patch is build-tested only, as I don't have any LRO-capable hardware.
> It might be prettier to move dev_disable_lro() to ethtool.c.
It *looks* right.
> net/core/dev.c | 20 ++++++++++++--------
> net/core/ethtool.c | 2 +-
> 2 files changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 0b88eba..105e082 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -1353,14 +1353,18 @@ EXPORT_SYMBOL(dev_close);
> */
> void dev_disable_lro(struct net_device *dev)
> {
> - if (dev->ethtool_ops && dev->ethtool_ops->get_flags &&
> - dev->ethtool_ops->set_flags) {
> - u32 flags = dev->ethtool_ops->get_flags(dev);
> - if (flags & ETH_FLAG_LRO) {
> - flags &= ~ETH_FLAG_LRO;
> - dev->ethtool_ops->set_flags(dev, flags);
> - }
> - }
> + extern int __ethtool_set_flags(struct net_device *, u32);
[...]
Local function declarations are a very bad idea, as they are not checked
against the function definition. Please declare the function in
<linux/ethtool.h>; that does not oblige us to export it.
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.
next prev parent reply other threads:[~2011-03-18 18:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-18 17:42 [PATCH] net: implement dev_disable_lro() hw_features compatibility Michał Mirosław
2011-03-18 18:13 ` Ben Hutchings [this message]
2011-03-18 19:43 ` David Miller
2011-03-19 2:56 ` [PATCH v2] " Michał Mirosław
2011-03-22 8:00 ` David Miller
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=1300471986.2589.26.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=mirq-linux@rere.qmqm.pl \
--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