From: Ben Hutchings <bhutchings@solarflare.com>
To: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: davem@davemloft.net, jeff@garzik.org, netdev@vger.kernel.org,
gospo@redhat.com
Subject: Re: [PATCH v4] ethtool: Add direct access to ops->get_sset_count
Date: Thu, 04 Mar 2010 14:26:37 +0000 [thread overview]
Message-ID: <1267712797.2819.149.camel@localhost> (raw)
In-Reply-To: <20100304085054.4471.44679.stgit@localhost.localdomain>
On Thu, 2010-03-04 at 00:51 -0800, Jeff Kirsher wrote:
> From: Jeff Garzik <jgarzik@redhat.com>
>
> This patch is an alternative approach for accessing string
> counts, vs. the drvinfo indirect approach. This way the drvinfo
> space doesn't run out, and we don't break ABI later.
[...]
> --- a/net/core/ethtool.c
> +++ b/net/core/ethtool.c
> @@ -214,6 +214,10 @@ static noinline int ethtool_get_drvinfo(struct net_device *dev, void __user *use
> info.cmd = ETHTOOL_GDRVINFO;
> ops->get_drvinfo(dev, &info);
>
> + /*
> + * this method of obtaining string set info is deprecated;
> + * consider using ETHTOOL_GSSET_INFO instead
> + */
This comment belongs on the interface (ethtool.h) not the
implementation.
[...]
> +static noinline int ethtool_get_sset_info(struct net_device *dev,
> + void __user *useraddr)
> +{
[...]
> + /* calculate size of return buffer */
> + for (i = 0; i < 64; i++)
> + if (sset_mask & (1ULL << i))
> + n_bits++;
[...]
We have a function for this:
n_bits = hweight64(sset_mask);
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
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:[~2010-03-04 14:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-04 8:51 [PATCH v4] ethtool: Add direct access to ops->get_sset_count Jeff Kirsher
2010-03-04 13:23 ` Jeff Garzik
2010-03-05 22:00 ` David Miller
2010-03-04 14:26 ` Ben Hutchings [this message]
2010-03-04 18:21 ` [PATCH] " Jeff Garzik
2010-03-05 22: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=1267712797.2819.149.camel@localhost \
--to=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=gospo@redhat.com \
--cc=jeff@garzik.org \
--cc=jeffrey.t.kirsher@intel.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).