From: Ben Hutchings <ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>
To: David Decotigny <ddecotig-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Amir Vadai <amirv-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Florian Fainelli
<f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
David Decotigny <decot-Ypc/8FJVVoBWk0Htik3J/w@public.gmane.org>,
"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
Jason Wang <jasowang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
"Michael S. Tsirkin"
<mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Herbert Xu
<herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>,
Al Viro <viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org>,
Masatake YAMATO <yamato-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Xi Wang <xii-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Neil Horman <nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>,
WANG Cong
<xiyou.wangcong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Flavio Leitner <fbl-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Tom Gundersen <teg-B22kvLQNl6c@public.gmane.org>,
Jiri Pirko <jiri-rHqAuBHg3fBzbRFIqnYvSA@public.gmane.org>,
Vlad Yasevich <vyasevic-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
"Eric W. Biederman"
<ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>,
Saeed Mahameed <saeedm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Venkata Duvvuru
<VenkatKumar.Duvvuru-iH1Dq9VlAzfQT0dZR+AlfA@public.gmane.org>,
Govindarajulu Varadarajan <_govind-KK0ffGbhmjU@public.gmane.org>
Subject: Re: [PATCH net-next v1 1/7] net: ethtool: extend link mode support to 48 bits
Date: Sun, 04 Jan 2015 22:01:07 +0000 [thread overview]
Message-ID: <1420408867.5686.145.camel@decadent.org.uk> (raw)
In-Reply-To: <1420405017-23278-2-git-send-email-ddecotig-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 3096 bytes --]
On Sun, 2015-01-04 at 12:56 -0800, David Decotigny wrote:
> From: David Decotigny <decot-Ypc/8FJVVoBWk0Htik3J/w@public.gmane.org>
This is mostly fine, with just a few minor issues.
> Signed-off-by: David Decotigny <decot-Ypc/8FJVVoBWk0Htik3J/w@public.gmane.org>
> ---
> include/uapi/linux/ethtool.h | 130 ++++++++++++++++++++++++++++++++++++-------
> 1 file changed, 110 insertions(+), 20 deletions(-)
>
> diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
> index 5f66d9c..61e7734 100644
> --- a/include/uapi/linux/ethtool.h
> +++ b/include/uapi/linux/ethtool.h
[...]
> @@ -123,6 +140,46 @@ static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
> return (ep->speed_hi << 16) | ep->speed;
> }
>
> +/**
> + * MAKE_ETHTOOL_LINK_MODE_ACCESSORS - create the link_mode accessors
> + * Macro to generate the %ethtool_cmd_supported_*,
> + * %ethtool_cmd_advertising_*, %ethtool_cmd_lp_advertising_*,
> + * %ethtool_eee_supported_*, %ethtool_eee_advertised_*,
> + * %ethtool_eee_lp_advertised_* families of functions.
> + *
> + * Macro args:
Delete the 'Macro args:' heading; that's implied by the @ prefixes.
> + * @struct_name: either %ethtool_cmd or %ethtool_eee
> + * @field_name: name of the fields in %struct_name to
> + * access. supported/advertising/lp_advertising for ethtool_cmd,
> + * supported/advertised/lp_advertised for ethtool_eee
> + *
> + * Generates the following static functions:
> + * @ethtool_cmd_supported(const struct ethtool_cmd*): returns
> + * the 64b value of %supported fields (the upper bits 63..48 are 0)
> + * @ethtool_cmd_supported_set(struct ethtool_cmd*,
> + * ethtool_link_mode_mask_t value): set the %supported fields to
> + * given %value (only the lower 48 bits used, upper bits 63..48
> + * ignored)
Delete the @ prefixes from these headings.
> + * Same doc for all the other functions.
> + */
> +#define MAKE_ETHTOOL_LINK_MODE_ACCESSORS(struct_name, field_name) \
I think the name should begin with ETHTOOL but it's not a big deal.
[...]
> @@ -1192,6 +1273,9 @@ enum ethtool_sfeatures_retval_bits {
> #define SPARC_ETH_GSET ETHTOOL_GSET
> #define SPARC_ETH_SSET ETHTOOL_SSET
>
> +/* Do not use the following macros directly to update
> + * ethtool_cmd::supported, ethtool_eee::supported. Please use
> + * ethtool_(cmd|eee)_supported(|_set) instead */
The ending */ belongs on a new line.
> #define SUPPORTED_10baseT_Half (1 << 0)
> #define SUPPORTED_10baseT_Full (1 << 1)
> #define SUPPORTED_100baseT_Half (1 << 2)
> @@ -1223,7 +1307,12 @@ enum ethtool_sfeatures_retval_bits {
> #define SUPPORTED_56000baseCR4_Full (1 << 28)
> #define SUPPORTED_56000baseSR4_Full (1 << 29)
> #define SUPPORTED_56000baseLR4_Full (1 << 30)
> +/* TODO: for bit indices >= 31, make sure to shift 1ULL instead of 1 */
[...]
I don't think that comment is necessary; the compiler will surely warn
if someone forgets.
Ben.
--
Ben Hutchings
This sentence contradicts itself - no actually it doesn't.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
next prev parent reply other threads:[~2015-01-04 22:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-04 20:56 [PATCH net-next v1 0/7] net: extend ethtool link mode bitmaps to 48 bits David Decotigny
2015-01-04 20:56 ` [PATCH net-next v1 1/7] net: ethtool: extend link mode support " David Decotigny
[not found] ` <1420405017-23278-2-git-send-email-ddecotig-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-01-04 22:01 ` Ben Hutchings [this message]
2015-01-04 20:56 ` [PATCH net-next v1 2/7] net: phy: " David Decotigny
[not found] ` <1420405017-23278-3-git-send-email-ddecotig-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-01-04 22:03 ` Ben Hutchings
2015-01-04 20:56 ` [PATCH net-next v1 3/7] net: mii: " David Decotigny
2015-01-04 20:56 ` [PATCH net-next v1 4/7] net: mdio: " David Decotigny
2015-01-04 20:56 ` [PATCH net-next v1 5/7] net: veth: " David Decotigny
2015-01-04 20:56 ` [PATCH net-next v1 6/7] net: tun: " David Decotigny
2015-01-04 20:56 ` [PATCH net-next v1 7/7] net: mlx4_en: " David Decotigny
[not found] ` <1420405017-23278-1-git-send-email-ddecotig-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-01-04 21:55 ` [PATCH net-next v1 0/7] net: extend ethtool link mode bitmaps " Ben Hutchings
[not found] ` <1420408540.5686.140.camel-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>
2015-01-05 0:34 ` Maciej Żenczykowski
2015-01-05 2:30 ` Ben Hutchings
2015-01-05 18:16 ` David Decotigny
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=1420408867.5686.145.camel@decadent.org.uk \
--to=ben-/+tvbiectbitmtq+vha3yw@public.gmane.org \
--cc=VenkatKumar.Duvvuru-iH1Dq9VlAzfQT0dZR+AlfA@public.gmane.org \
--cc=_govind-KK0ffGbhmjU@public.gmane.org \
--cc=amirv-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=ddecotig-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=decot-Ypc/8FJVVoBWk0Htik3J/w@public.gmane.org \
--cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
--cc=f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=fbl-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org \
--cc=jasowang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=jiri-rHqAuBHg3fBzbRFIqnYvSA@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org \
--cc=saeedm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=teg-B22kvLQNl6c@public.gmane.org \
--cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org \
--cc=vyasevic-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=xii-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=xiyou.wangcong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=yamato-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.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).