From: Andrew Lunn <andrew@lunn.ch>
To: Michal Kubecek <mkubecek@suse.cz>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Jiri Pirko <jiri@resnulli.us>, David Miller <davem@davemloft.net>,
Florian Fainelli <f.fainelli@gmail.com>,
Roopa Prabhu <roopa@cumulusnetworks.com>,
Jakub Kicinski <kubakici@wp.pl>,
"John W. Linville" <linville@tuxdriver.com>
Subject: Re: [RFC PATCH net-next v2 09/17] ethtool: implement GET_DRVINFO message
Date: Mon, 30 Jul 2018 16:28:25 +0200 [thread overview]
Message-ID: <20180730142825.GL13198@lunn.ch> (raw)
In-Reply-To: <4dcd60f25efe368ada4e0c035dc1d7612ab59132.1532953989.git.mkubecek@suse.cz>
On Mon, Jul 30, 2018 at 02:53:27PM +0200, Michal Kubecek wrote:
> Requests the same information as ETHTOOL_GDRVINFO command in ioct
> interface. This is read-only so that corresponding SET_DRVINFO exists but
> is only used in kernel replies.
>
> Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
> ---
> Documentation/networking/ethtool-netlink.txt | 38 +++++-
> include/uapi/linux/ethtool_netlink.h | 22 ++++
> net/ethtool/Makefile | 4 +-
> net/ethtool/common.c | 43 ++++++
> net/ethtool/common.h | 3 +
> net/ethtool/drvinfo.c | 131 +++++++++++++++++++
> net/ethtool/ioctl.c | 42 +-----
> net/ethtool/netlink.c | 8 ++
> 8 files changed, 252 insertions(+), 39 deletions(-)
> create mode 100644 net/ethtool/drvinfo.c
>
> diff --git a/Documentation/networking/ethtool-netlink.txt b/Documentation/networking/ethtool-netlink.txt
> index 8b43f41a8140..1e3d5ffc97ab 100644
> --- a/Documentation/networking/ethtool-netlink.txt
> +++ b/Documentation/networking/ethtool-netlink.txt
> @@ -121,6 +121,8 @@ List of message types
> ETHNL_CMD_EVENT notification only
> ETHNL_CMD_GET_STRSET
> ETHNL_CMD_SET_STRSET response only
> + ETHNL_CMD_GET_DRVINFO
> + ETHNL_CMD_SET_DRVINFO response only
>
> All constants use ETHNL_CMD_ prefix, usually followed by "GET", "SET" or "ACT"
> to indicate the type.
> @@ -156,6 +158,40 @@ and also multiple events of the same type (e.g. two or more newly registered
> devices).
>
>
> +GET_DRVINFO
> +-----------
> +
> +GET_DRVINFO request corresponds to ETHTOOL_GDRVINFO ioctl command and provides
> +basic driver information.
> +
> +Request contents:
> +
> + ETHA_DRVINFO_DEV (nested) device identification
> +
> +Kernel response contents:
> +
> + ETHA_DRVINFO_DEV (nested) device identification
> + ETHA_DRVINFO_DRIVER (string) driver name
> + ETHA_DRVINFO_VERSION (string) driver version
Driver version is generally useless. Is version X.Y.Z of a driver the
same when backported to some ancient enterprise kernel with 1000s of
patches? Now seems like a good opportunity to drop it.
> + ETHA_DRVINFO_FWVERSION (string) firmware version
> + ETHA_DRVINFO_BUSINFO (string) device bus address
> + ETHA_DRVINFO_EROM_VER (string) expansion ROM version
> + ETHA_DRVINFO_N_PRIV_FLAGS (u32) number of private flags
> + ETHA_DRVINFO_N_STATS (u32) number of device stats
I know there is at least one driver that has somewhat dynamic number
of statistics. It would be better to have the strings and the values
in the same message, so there is no need to first get the number of
strings, allocate the memory, get the strings, then get the values.
> + ETHA_DRVINFO_TESTINFO_LEN (u32) number of test results
In theory, this also does not need to be fixed.
> + ETHA_DRVINFO_EEDUMP_LEN (u32) EEPROM dump size
> + ETHA_DRVINFO_REGDUMP_LEN (u32) register dump size
I would suggest removing all these _LEN properties, and let netlink
return what it needs to return.
Andrew
next prev parent reply other threads:[~2018-07-30 14:28 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-30 12:52 [RFC PATCH net-next v2 00/17] ethtool netlink interface (WiP) Michal Kubecek
2018-07-30 12:52 ` [RFC PATCH net-next v2 01/17] netlink: introduce nla_put_bitfield32() Michal Kubecek
2018-07-30 12:52 ` [RFC PATCH net-next v2 02/17] ethtool: move to its own directory Michal Kubecek
2018-07-30 12:52 ` [RFC PATCH net-next v2 03/17] ethtool: introduce ethtool netlink interface Michal Kubecek
2018-07-30 12:53 ` [RFC PATCH net-next v2 04/17] ethtool: helper functions for " Michal Kubecek
2018-07-30 12:53 ` [RFC PATCH net-next v2 05/17] ethtool: netlink bitset handling Michal Kubecek
2018-07-30 12:53 ` [RFC PATCH net-next v2 06/17] ethtool: support for netlink notifications Michal Kubecek
2018-07-30 13:16 ` Jiri Pirko
2018-07-30 17:01 ` Michal Kubecek
2018-07-31 6:46 ` Jiri Pirko
2018-07-30 12:53 ` [RFC PATCH net-next v2 07/17] ethtool: implement EVENT notifications Michal Kubecek
2018-07-30 12:53 ` [RFC PATCH net-next v2 08/17] ethtool: implement GET_STRSET message Michal Kubecek
2018-07-30 12:53 ` [RFC PATCH net-next v2 09/17] ethtool: implement GET_DRVINFO message Michal Kubecek
2018-07-30 13:21 ` Jiri Pirko
2018-07-30 14:37 ` Michal Kubecek
2018-07-30 14:28 ` Andrew Lunn [this message]
2018-07-30 14:46 ` Michal Kubecek
2018-07-30 15:48 ` Andrew Lunn
2018-07-30 16:47 ` Michal Kubecek
2018-07-31 0:56 ` Jakub Kicinski
2018-07-30 12:53 ` [RFC PATCH net-next v2 10/17] ethtool: implement GET_SETTINGS message Michal Kubecek
2018-07-30 18:54 ` Andrew Lunn
2018-08-21 9:32 ` Michal Kubecek
2018-08-21 14:10 ` Andrew Lunn
2018-08-21 14:52 ` Michal Kubecek
2018-07-30 19:06 ` Andrew Lunn
2018-07-30 19:09 ` Andrew Lunn
2018-07-30 19:42 ` Michal Kubecek
2018-07-30 12:53 ` [RFC PATCH net-next v2 11/17] ethtool: implement GET_SETTINGS request for features Michal Kubecek
2018-07-30 12:53 ` [RFC PATCH net-next v2 12/17] ethtool: implement SET_SETTINGS notification Michal Kubecek
2018-07-30 12:53 ` [RFC PATCH net-next v2 13/17] ethtool: implement SET_SETTINGS message Michal Kubecek
2018-07-30 12:53 ` [RFC PATCH net-next v2 14/17] ethtool: implement SET_SETTINGS request for features Michal Kubecek
2018-07-30 12:53 ` [RFC PATCH net-next v2 15/17] ethtool: implement GET_PARAMS message Michal Kubecek
2018-07-30 12:54 ` [RFC PATCH net-next v2 16/17] ethtool: implement SET_PARAMS notification Michal Kubecek
2018-07-30 12:54 ` [RFC PATCH net-next v2 17/17] ethtool: implement SET_PARAMS message Michal Kubecek
2018-07-30 13:07 ` [RFC PATCH net-next v2 00/17] ethtool netlink interface (WiP) Jiri Pirko
2018-07-31 0:38 ` Jakub Kicinski
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=20180730142825.GL13198@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=jiri@resnulli.us \
--cc=kubakici@wp.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=roopa@cumulusnetworks.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