netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Michal Kubecek <mkubecek@suse.cz>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 5/9] ethtool: implement GET_DRVINFO message
Date: Mon, 11 Dec 2017 17:16:01 +0100	[thread overview]
Message-ID: <20171211161601.GB1885@nanopsycho> (raw)
In-Reply-To: <219f457821c4cbca64ead6a8f8a92246ed7f32a3.1513000306.git.mkubecek@suse.cz>

Mon, Dec 11, 2017 at 02:54:01PM CET, mkubecek@suse.cz wrote:
>Request the same information as ETHTOOL_GDRVINFO. This is read-only so that
>corresponding SET_DRVINFO exists but is only used in kernel replies. Rip
>the code to query the driver out of the legacy interface and move it to
>a new file ethtool_common.c so that both interfaces can use it.
>
>Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
>---
> Documentation/networking/ethtool-netlink.txt | 30 ++++++++++-
> include/uapi/linux/ethtool_netlink.h         | 21 ++++++++
> net/core/Makefile                            |  2 +-
> net/core/ethtool.c                           | 42 +++-------------
> net/core/ethtool_common.c                    | 46 +++++++++++++++++
> net/core/ethtool_common.h                    | 11 ++++
> net/core/ethtool_netlink.c                   | 75 ++++++++++++++++++++++++++++
> 7 files changed, 189 insertions(+), 38 deletions(-)
> create mode 100644 net/core/ethtool_common.c
> create mode 100644 net/core/ethtool_common.h
>
>diff --git a/Documentation/networking/ethtool-netlink.txt b/Documentation/networking/ethtool-netlink.txt
>index 893e5156f6a7..cb992180b211 100644
>--- a/Documentation/networking/ethtool-netlink.txt
>+++ b/Documentation/networking/ethtool-netlink.txt
>@@ -107,6 +107,9 @@ which the request applies.
> List of message types
> ---------------------
> 
>+    ETHTOOL_CMD_GET_DRVINFO
>+    ETHTOOL_CMD_SET_DRVINFO		response only
>+
> All constants use ETHTOOL_CMD_ prefix followed by "GET", "SET" or "ACT" to
> indicate the type.
> 
>@@ -119,6 +122,31 @@ messages marked as "response only" in the table above.
> Later sections describe the format and semantics of these request messages.
> 
> 
>+GET_DRVINFO
>+-----------
>+
>+GET_DRVINFO request corresponds to ETHTOOL_GDRVINFO ioctl command and provides
>+basic driver information. The request doesn't use any attributes and flags,
>+info_mask and index field in request header are ignored. Kernel response
>+contents:
>+
>+    ETHA_DRVINFO_DRIVER		(string)	driver name
>+    ETHA_DRVINFO_VERSION	(string)	driver version

You use 3 prefixes:
ETHTOOL_ for cmd
ETHA_ for attrs
ethnl_ for function

I suggest to sync this, perhaps to:
ETHNL_CMD_*
ETHNL_ATTR_*
ethnl_*
?


>+    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
>+    ETHA_DRVINFO_TESTINFO_LEN	(u32)		number of test results
>+    ETHA_DRVINFO_EEDUMP_LEN	(u32)		EEPROM dump size
>+    ETHA_DRVINFO_REGDUMP_LEN	(u32)		register dump size

We are now working on providing various fw memory regions dump in
devlink. It makes sense to have it in devlink for couple of reasons:
1) per-asic, not netdev specific, therefore does not really make sense
   to have netdev as handle, but rather devlink handle.
2) snapshot support - we need to provide support for getting snapshot
   (for example on failure), transferring to user and deleting it
   (remove from driver memory).

Also, driver name, version, fwversion, etc is per-asic. Would make sense
to have it in devlink as well.

I think this is great opprotunity to move things where they should be to
be alligned with the current world and kernel infrastructure.

  reply	other threads:[~2017-12-11 16:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 13:53 [RFC PATCH 0/9] ethtool netlink interface (WiP) Michal Kubecek
2017-12-11 13:53 ` [RFC PATCH 1/9] netlink: introduce nla_put_bitfield32() Michal Kubecek
2017-12-11 13:53 ` [RFC PATCH 2/9] ethtool: introduce ethtool netlink interface Michal Kubecek
2017-12-11 16:02   ` Jiri Pirko
2017-12-11 16:56     ` David Miller
2017-12-11 18:02       ` Jiri Pirko
2017-12-11 18:45         ` David Miller
2017-12-12 23:56           ` Michal Kubecek
2017-12-11 13:53 ` [RFC PATCH 3/9] ethtool: helper functions for " Michal Kubecek
2017-12-11 13:53 ` [RFC PATCH 4/9] ethtool: netlink bitset handling Michal Kubecek
2017-12-11 13:54 ` [RFC PATCH 5/9] ethtool: implement GET_DRVINFO message Michal Kubecek
2017-12-11 16:16   ` Jiri Pirko [this message]
2017-12-12 23:54     ` Michal Kubecek
2017-12-13  6:57       ` Jiri Pirko
2017-12-11 13:54 ` [RFC PATCH 6/9] ethtool: implement GET_SETTINGS message Michal Kubecek
2017-12-11 13:54 ` [RFC PATCH 7/9] ethtool: implement SET_SETTINGS message Michal Kubecek
2017-12-11 13:54 ` [RFC PATCH 8/9] ethtool: implement GET_PARAMS message Michal Kubecek
2017-12-11 13:54 ` [RFC PATCH 9/9] ethtool: implement SET_PARAMS message Michal Kubecek
2017-12-11 16:32 ` [RFC PATCH 0/9] ethtool netlink interface (WiP) Jiri Pirko
2017-12-11 17:01   ` David Miller
2017-12-11 17:59     ` Jiri Pirko
2017-12-11 19:03     ` Florian Fainelli
2017-12-12 15:32 ` Roopa Prabhu
2017-12-12 23:47   ` Jakub Kicinski
2017-12-14 21:07 ` John W. Linville
2017-12-18 19:39   ` David Miller

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=20171211161601.GB1885@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.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).