[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTikzQOQDDpeaiQkZR7OR-pBPaVFz3A@mail.gmail.com>
Date: Tue, 24 May 2011 16:11:03 -0700
From: Mahesh Bandewar <maheshb@...gle.com>
To: Michał Mirosław <mirqus@...il.com>
Cc: David Miller <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
Tom Herbert <therbert@...gle.com>
Subject: Re: [PATCH] net: Abstract features usage.
On Tue, May 24, 2011 at 2:49 PM, Michał Mirosław <mirqus@...il.com> wrote:
> W dniu 24 maja 2011 22:29 użytkownik Mahesh Bandewar
> <maheshb@...gle.com> napisał:
>> On Tue, May 24, 2011 at 12:37 PM, Michał Mirosław <mirqus@...il.com> wrote:
>>>
>>> 2011/5/24 Mahesh Bandewar <maheshb@...gle.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@...gle.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.
>
Alright, will split the change into two pieces.
>> 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).
>
The older fields give us longer time frame to make these changes where
ever necessary. Also enable us to make these changes in stages. Once
all the changes are in place, the older-fields along with the code
instrumentation will be removed. So yes, this file / macros / inlines
will be touched at the end of the completion of the last phase.
Thanks,
--mahesh..
> Best Regards,
> Michał Mirosław
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists