From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: davem@davemloft.net, netdev@vger.kernel.org, oss-drivers@netronome.com
Subject: Re: [RFC net-next 4/6] nfp: devlink: report fixed versions
Date: Tue, 15 Jan 2019 10:09:13 -0800 [thread overview]
Message-ID: <20190115100913.206d9672@cakuba.netronome.com> (raw)
In-Reply-To: <20190115101818.GE2290@nanopsycho>
On Tue, 15 Jan 2019 11:18:18 +0100, Jiri Pirko wrote:
> Tue, Jan 15, 2019 at 01:50:06AM CET, jakub.kicinski@netronome.com wrote:
> >For now we only use HWinfo for fixed versions.
> >
> >Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> >---
> > .../net/ethernet/netronome/nfp/nfp_devlink.c | 72 +++++++++++++++++++
> > 1 file changed, 72 insertions(+)
> >
> >diff --git a/drivers/net/ethernet/netronome/nfp/nfp_devlink.c b/drivers/net/ethernet/netronome/nfp/nfp_devlink.c
> >index 4422da939937..c7759564316d 100644
> >--- a/drivers/net/ethernet/netronome/nfp/nfp_devlink.c
> >+++ b/drivers/net/ethernet/netronome/nfp/nfp_devlink.c
> >@@ -192,6 +192,77 @@ nfp_devlink_serial_get(struct devlink *devlink, u8 *buf, size_t buf_len,
> > return 0;
> > }
> >
> >+static const struct nfp_devlink_versions_simple {
> >+ const char *key;
> >+ const char *hwinfo;
> >+} nfp_devlink_versions_hwinfo[] = {
> >+ { "board.model", "assembly.model", },
> >+ { "board.partno", "assembly.partno", },
> >+ { "board.revision", "assembly.revision", },
> >+ { "board.vendor", "assembly.vendor", },
>
> That means that every driver would re-define these strings. Would it
> make sense to have them (at least some of them) defined in a generic
> way? Something in a sense of devlink params, where we have generic and
> driver-specific ones.
Ack, I will add those as defines in the devlink header plus some docs.
Let's see how it goes..
> >+};
> >+
> >+static int
> >+nfp_devlink_versions_get_hwinfo(struct sk_buff *skb, struct nfp_nsp *nsp,
> >+ struct netlink_ext_ack *extack)
> >+{
> >+ unsigned int i;
> >+ int attr;
> >+ int err;
> >+
> >+ attr = DEVLINK_ATTR_INFO_VERSIONS_FIXED;
> >+
> >+ for (i = 0; i < ARRAY_SIZE(nfp_devlink_versions_hwinfo); i++) {
> >+ const struct nfp_devlink_versions_simple *info;
> >+ char buf[256] = {};
> >+
> >+ info = &nfp_devlink_versions_hwinfo[i];
> >+ strcpy(buf, info->hwinfo);
> >+
> >+ err = nfp_nsp_hwinfo_lookup(nsp, buf, sizeof(buf));
> >+ if (err == -ENOENT)
> >+ continue;
> >+ if (err) {
> >+ NL_SET_ERR_MSG_MOD(extack,
> >+ "error reading versions string from FW");
> >+ return err;
> >+ }
> >+
> >+ err = devlink_versions_report(skb, attr, info->key, buf);
>
> So this is always "DEVLINK_ATTR_INFO_VERSIONS_FIXED". I don't
> understand.
Tmp var makes it look more like the other function (from next patch)...
and it makes the line fit in 80 char ;)
next prev parent reply other threads:[~2019-01-15 18:09 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-15 0:50 [RFC net-next 0/6] devlink: add device (driver) information API Jakub Kicinski
2019-01-15 0:50 ` [RFC net-next 1/6] devlink: add device " Jakub Kicinski
2019-01-15 10:15 ` Jiri Pirko
2019-01-15 17:41 ` Jakub Kicinski
2019-01-15 20:00 ` Andrew Lunn
2019-01-15 21:42 ` Jakub Kicinski
2019-01-15 0:50 ` [RFC net-next 2/6] devlink: add version reporting API Jakub Kicinski
2019-01-15 10:12 ` Jiri Pirko
2019-01-15 0:50 ` [RFC net-next 3/6] nfp: devlink: report serial number Jakub Kicinski
2019-01-15 0:50 ` [RFC net-next 4/6] nfp: devlink: report fixed versions Jakub Kicinski
2019-01-15 10:18 ` Jiri Pirko
2019-01-15 18:09 ` Jakub Kicinski [this message]
2019-01-15 0:50 ` [RFC net-next 5/6] nfp: nsp: add support for versions command Jakub Kicinski
2019-01-15 0:50 ` [RFC net-next 6/6] nfp: devlink: report the running and flashed versions Jakub Kicinski
2019-01-15 0:50 ` [RFC iproute2-next] devlink: add info subcommand Jakub Kicinski
2019-01-15 8:20 ` Jiri Pirko
2019-01-15 14:00 ` Andrew Lunn
2019-01-15 14:07 ` Jiri Pirko
2019-01-15 17:58 ` Jakub Kicinski
2019-01-15 17:53 ` Jakub Kicinski
2019-01-15 18:05 ` Jiri Pirko
2019-01-15 18:32 ` Jakub Kicinski
2019-01-15 1:00 ` [RFC net-next 0/6] devlink: add device (driver) information API Florian Fainelli
2019-01-15 1:18 ` Andrew Lunn
2019-01-15 1:33 ` Jakub Kicinski
2019-01-15 1:57 ` Andrew Lunn
2019-01-15 3:27 ` Jakub Kicinski
2019-01-15 7:36 ` Michal Kubecek
2019-01-15 8:12 ` Jiri Pirko
2019-01-15 19:30 ` Jonathan Lemon
2019-01-15 21:06 ` Jakub Kicinski
2019-01-15 23:41 ` Jiri Pirko
2019-01-16 19:00 ` Jonathan Lemon
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=20190115100913.206d9672@cakuba.netronome.com \
--to=jakub.kicinski@netronome.com \
--cc=davem@davemloft.net \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.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).