From: Ben Hutchings <bhutchings@solarflare.com>
To: David Laight <David.Laight@ACULAB.COM>
Cc: <netdev@vger.kernel.org>, <linux-net-drivers@solarflare.com>
Subject: Re: [PATCH ethtool] sfc: Add support for EF10 registers
Date: Mon, 23 Sep 2013 17:52:02 +0100 [thread overview]
Message-ID: <1379955122.2485.47.camel@bwh-desktop.uk.level5networks.com> (raw)
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B7354@saturn3.aculab.com>
On Mon, 2013-09-23 at 17:14 +0100, David Laight wrote:
> > struct efx_nic_reg_field {
> > const char *name;
> > u32 lbn:7, width:8;
> > - u32 min_revision:2, max_revision:2;
> > + u32 min_revision:3, max_revision:3;
> > };
> ...
> > struct efx_nic_reg_table {
> > const char *name;
> > const struct efx_nic_reg_field *fields;
> > u32 field_count:7;
> > - u32 min_revision:2, max_revision:2;
> > + u32 min_revision:3, max_revision:3;
> > u32 step:6, rows:21;
> > };
>
> These bitfields look rather pointless.
> AFACT the size of the structures wouldn't change if the fields
> were just u8 or u32. The code would be a lot smaller.
The definition of struct efx_nic_reg_table is based on the structure of
the same name in the driver, where I think the bitfields do provide a
net saving (but I'm not sure). efx_nic_reg_field is specific to ethtool
and the bitfields there are indeed pointless.
Changing to u8 and u32 as appropriate saved about 200 bytes on an x86_64
build here.
Ben.
--
Ben Hutchings, Staff 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:[~2013-09-23 16:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-23 16:04 [PATCH ethtool] sfc: Add support for EF10 registers Ben Hutchings
2013-09-23 16:14 ` David Laight
2013-09-23 16:52 ` Ben Hutchings [this message]
2013-09-23 17:42 ` missing kfree_skb(skb) in ipv6_frag_rcv()? Templin, Fred L
2013-09-23 18:37 ` Eric Dumazet
2013-09-23 19:32 ` Templin, Fred L
2013-10-01 15:36 ` [PATCH ethtool] sfc: Add support for EF10 registers Ben Hutchings
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=1379955122.2485.47.camel@bwh-desktop.uk.level5networks.com \
--to=bhutchings@solarflare.com \
--cc=David.Laight@ACULAB.COM \
--cc=linux-net-drivers@solarflare.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