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>,
Stephen Hemminger <shemminger@vyatta.com>
Subject: Re: [PATCHv2] net: Define enum for the bits used in features.
Date: Wed, 25 May 2011 11:43:50 +0200 [thread overview]
Message-ID: <BANLkTik4KYrR4vYm1R_hYNbwFjQ79FEoHQ@mail.gmail.com> (raw)
In-Reply-To: <1306288567-1773-1-git-send-email-maheshb@google.com>
2011/5/25 Mahesh Bandewar <maheshb@google.com>:
> Little bit cleanup by defining enum for all bits used. Also use those enum
> values to redefine flags.
>
> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
> ---
> Changes since v1:
> Split the patch into two pieces.
>
> include/linux/netdevice.h | 100 +++++++++++++++++++++++++++++++-------------
> 1 files changed, 70 insertions(+), 30 deletions(-)
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index ca333e7..b4520b2 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -51,6 +51,7 @@
> #ifdef CONFIG_DCB
> #include <net/dcbnl.h>
> #endif
> +#include <linux/netdev_features.h>
This should go to other part.
> struct vlan_group;
> struct netpoll_info;
> @@ -981,6 +982,49 @@ struct net_device_ops {
> };
>
> /*
> + * Net device feature bits; if you change something,
> + * also update netdev_features_strings[] in ethtool.c
> + */
> +enum netdev_features {
[...]
> + RESERVED16_BIT, /* the GSO_MASK reserved bit 16 */
> + RESERVED17_BIT, /* the GSO_MASK reserved bit 17 */
> + RESERVED18_BIT, /* the GSO_MASK reserved bit 18 */
> + RESERVED19_BIT, /* the GSO_MASK reserved bit 19 */
> + RESERVED20_BIT, /* the GSO_MASK reserved bit 20 */
> + RESERVED21_BIT, /* the GSO_MASK reserved bit 21 */
> + RESERVED22_BIT, /* the GSO_MASK reserved bit 22 */
> + RESERVED23_BIT, /* the GSO_MASK reserved bit 23 */
This could also define NETIF_F_GSO_SHIFT and name TSO and others.
Maybe like this:
NETIF_F_GSO_SHIFT, /* must == 16, for now */
GSO_RESERVED0_BIT = NETIF_F_GSO_SHIFT,
GSO_RESERVED1_BIT,
...
GSO_RESERVED7_BIT,
... (other bits)
> + /* Add you bit above this */
your.
> + ND_FEATURE_NUM_BITS, /* (LAST VALUE) Total bits in use */
And here GSO aliases:
TSO_BIT = NETIF_F_GSO_SHIFT + SKB_GSO_TCPV4,
UFO_BIT = NETIF_F_GSO_SHIFT + SKB_GSO_UDP,
...
Afther this is done, I can convert the feature-names table in
ethtool.c to use C99 array assignments, so that no one else will trip
on a missing comma or wrong entries order there.
About the bit names: NETIF_F_xxx_BIT?
Best Regards,
Michał Mirosław
next prev parent reply other threads:[~2011-05-25 9:44 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
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 [this message]
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=BANLkTik4KYrR4vYm1R_hYNbwFjQ79FEoHQ@mail.gmail.com \
--to=mirqus@gmail.com \
--cc=davem@davemloft.net \
--cc=maheshb@google.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
--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).