From: Ben Hutchings <bhutchings@solarflare.com>
To: Mahesh Bandewar <maheshb@google.com>
Cc: "David Miller" <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
"Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Subject: Re: [PATCH 2/9] net-ethtool: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
Date: Sun, 24 Apr 2011 06:30:40 +0100 [thread overview]
Message-ID: <1303623041.3032.97.camel@localhost> (raw)
In-Reply-To: <1303515367-25595-3-git-send-email-maheshb@google.com>
On Fri, 2011-04-22 at 16:36 -0700, Mahesh Bandewar wrote:
> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
> ---
> include/linux/ethtool.h | 26 +++++++------
> net/core/ethtool.c | 89 ++++++++++++++++------------------------------
> 2 files changed, 45 insertions(+), 70 deletions(-)
>
> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
> index 9de3127..71e8a02 100644
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -605,10 +605,10 @@ struct ethtool_flash {
> * @never_changed: mask of features not changeable for any device
> */
> struct ethtool_get_features_block {
> - __u32 available;
> - __u32 requested;
> - __u32 active;
> - __u32 never_changed;
> + __u64 available;
> + __u64 requested;
> + __u64 active;
> + __u64 never_changed;
> };
>
> /**
> @@ -618,10 +618,11 @@ struct ethtool_get_features_block {
> * out: number of elements in features[] needed to hold all features
> * @features: state of features
> */
> +/* TODO Why is this needed XXX */
Precisely to allow for expansion to more than 32 bits.
> struct ethtool_gfeatures {
> __u32 cmd;
> __u32 size;
> - struct ethtool_get_features_block features[0];
> + struct ethtool_get_features_block features;
> };
>
> /**
> @@ -630,8 +631,8 @@ struct ethtool_gfeatures {
> * @requested: values of features to be changed
> */
> struct ethtool_set_features_block {
> - __u32 valid;
> - __u32 requested;
> + __u64 valid;
> + __u64 requested;
> };
>
> /**
> @@ -640,10 +641,11 @@ struct ethtool_set_features_block {
> * @size: array size of the features[] array
> * @features: feature change masks
> */
> +/* TODO Why is this needed XXX */
> struct ethtool_sfeatures {
> __u32 cmd;
> __u32 size;
> - struct ethtool_set_features_block features[0];
> + struct ethtool_set_features_block features;
> };
[...]
These structures are part of the userland API, but they are new in
2.6.39. So they can still be changed up until 2.6.39 is released, but
not afterwards.
If we think 64 bits will be enough for the next 10 years, then let's
just go with a single 64-bit feature word. If we're not so sure then
then the ethtool API should continue to allow for multiple words
(whether 32-bit or 64-bit).
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-04-24 5:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-22 23:35 [PATCH 0/9] Convert features fields from u32 to type u64 Mahesh Bandewar
2011-04-22 23:35 ` [PATCH 1/9] net-dev: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64 Mahesh Bandewar
2011-04-22 23:36 ` [PATCH 2/9] net-ethtool: " Mahesh Bandewar
2011-04-22 23:36 ` [PATCH 3/9] net-core: " Mahesh Bandewar
2011-04-22 23:36 ` [PATCH 4/9] net-tcp: " Mahesh Bandewar
2011-04-22 23:36 ` [PATCH 5/9] net-udp: " Mahesh Bandewar
2011-04-22 23:36 ` [PATCH 6/9] net-vlan: " Mahesh Bandewar
2011-04-22 23:36 ` [PATCH 7/9] net-bridge: " Mahesh Bandewar
2011-04-22 23:36 ` [PATCH 8/9] net-ipv4: " Mahesh Bandewar
2011-04-22 23:36 ` [PATCH 9/9] net-ipv6: " Mahesh Bandewar
2011-04-24 5:30 ` Ben Hutchings [this message]
2011-04-25 5:28 ` [PATCH 2/9] net-ethtool: " David Miller
2011-04-25 18:14 ` Mahesh Bandewar
2011-04-25 8:48 ` Michał Mirosław
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=1303623041.3032.97.camel@localhost \
--to=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=maheshb@google.com \
--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;
as well as URLs for NNTP newsgroup(s).