netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michał Mirosław" <mirqus@gmail.com>
To: Mahesh Bandewar <maheshb@google.com>
Cc: David Miller <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	Tom Herbert <therbert@google.com>
Subject: Re: [PATCH] net: Abstract features usage.
Date: Tue, 24 May 2011 23:49:19 +0200	[thread overview]
Message-ID: <BANLkTinpNJz-6y1hvw6uzDJsixHHLEuA-w@mail.gmail.com> (raw)
In-Reply-To: <BANLkTi=F_=Ti=QdDf3-L_hEEwCi9DRR_1Q@mail.gmail.com>

W dniu 24 maja 2011 22:29 użytkownik Mahesh Bandewar
<maheshb@google.com> napisał:
> On Tue, May 24, 2011 at 12:37 PM, Michał Mirosław <mirqus@gmail.com> wrote:
>>
>> 2011/5/24 Mahesh Bandewar <maheshb@google.com>:
>> > Define macros to set/clear/test bits for feature set usage. This will eliminate
>> > the direct use of these fields and enable future ease in managing these fields.
>> >
>> > Signed-off-by: Mahesh Bandewar <maheshb@google.com>
>> > ---
>> >  include/linux/netdev_features.h |  137 +++++++++++++++++++++++++++++++++++++++
>> >  include/linux/netdevice.h       |   35 ++---------
>> >  2 files changed, 142 insertions(+), 30 deletions(-)
>> >  create mode 100644 include/linux/netdev_features.h
>> >
>> > diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
>> > new file mode 100644
>> > index 0000000..97bf8c4
>> > --- /dev/null
>> > +++ b/include/linux/netdev_features.h
>> > @@ -0,0 +1,137 @@
>> > +#ifndef        _NETDEV_FEATURES_H
>> > +#define        _NETDEV_FEATURES_H
>> > +
>> > +/* Forward declarations */
>> > +struct net_device;
>> > +
>> > +typedef        unsigned long *nd_feature_t;
>> > +
>> > +/* Net device feature bits; if you change something,
>> > + * also update netdev_features_strings[] in ethtool.c */
>> > +enum netdev_features {
>> > +       SG_BIT,                 /* Scatter/gather IO. */
>> [...]
>>
>> Please split this change (introducing enum + converting NETIF_F_*
>> defines to use it). This part is a nice cleanup, but I think the
>> bitmap idea is still not worth the trouble until u64 runs out.
> What will we achieve by this split? May be I'm not getting your point
> about split. Do you want to see the cleanup part as a separate patch?
> These enums and NETIF_F_* values have to be in sync.

Exactly. You already did the cleanup (defining enum and NETIF_F_*
#defines), so just split it into separate patch. This is a
prerequisite to any change to the type holding features from u32 to
either u64 or bitmap. And this will separate the cleanup from your
proposed idea.

> The macros that I have defined are expecting this bit numbers rather
> than the flag value.
> Whether it is u64 or bitmap, the changes should be limited to this
> file. Going forward that can be achieved by
> simply changing few lines in these macros / inlines.

One thing I don't like in this implementation is that it leaves old
fields around - so you'll have two code templates in the kernel doing
the same thing (unless you fix all users, but then you won't need old
fields anyway).

Best Regards,
Michał Mirosław

  reply	other threads:[~2011-05-24 21:49 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-24 18:52 [PATCH] net: Abstract features usage Mahesh Bandewar
2011-05-24 19:37 ` Michał Mirosław
2011-05-24 20:29   ` Mahesh Bandewar
2011-05-24 21:49     ` Michał Mirosław [this message]
2011-05-24 23:11       ` Mahesh Bandewar
2011-05-24 21:29 ` Stephen Hemminger
2011-05-24 23:04   ` Mahesh Bandewar
2011-05-24 23:11     ` Stephen Hemminger
2011-05-24 23:25       ` Mahesh Bandewar
2011-05-25  1:55 ` [PATCHv2] " Mahesh Bandewar
2011-05-25 22:43   ` [PATCHv3] " Mahesh Bandewar
2011-05-25  1:56 ` [PATCHv2] net: Define enum for the bits used in features Mahesh Bandewar
2011-05-25  7:58   ` Hagen Paul Pfeifer
2011-05-25  9:43   ` Michał Mirosław
2011-05-25  9:48     ` Michał Mirosław
2011-05-25 18:05     ` Mahesh Bandewar
2011-05-25 22:42   ` [PATCHv3] " Mahesh Bandewar
2011-05-26 10:40     ` Michał Mirosław
2011-05-27  9:25     ` [RFC PATCH] net: ethtool: use C99 array initialization for feature-names table Michał Mirosław
2011-06-04 20:34     ` [PATCHv3] net: Define enum for the bits used in features David Miller
2011-06-06  3:58       ` Michael S. Tsirkin
2011-06-06  5:15         ` David Miller
2011-06-06 15:32           ` Michael S. Tsirkin
2011-06-06 19:20             ` David Miller
2011-06-06 20:35               ` Michael S. Tsirkin
2011-06-09 16:46                 ` Michael S. Tsirkin
2011-06-09 20:12                   ` Michael S. Tsirkin
2011-06-08  6:55               ` Mahesh Bandewar
2011-06-06 15: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=BANLkTinpNJz-6y1hvw6uzDJsixHHLEuA-w@mail.gmail.com \
    --to=mirqus@gmail.com \
    --cc=davem@davemloft.net \
    --cc=maheshb@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=therbert@google.com \
    /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).