From: Ido Schimmel <idosch@idosch.org>
To: Jacob Keller <jacob.e.keller@intel.com>
Cc: Jakub Kicinski <kuba@kernel.org>, Jiri Pirko <jiri@resnulli.us>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
petrm@mellanox.com, amitc@mellanox.com
Subject: Re: devlink interface for asynchronous event/messages from firmware?
Date: Thu, 21 May 2020 23:52:13 +0300 [thread overview]
Message-ID: <20200521205213.GA1093714@splinter> (raw)
In-Reply-To: <b0435043-269b-9694-b43e-f6740d1862c9@intel.com>
On Thu, May 21, 2020 at 01:22:34PM -0700, Jacob Keller wrote:
> On 5/20/2020 5:16 PM, Jakub Kicinski wrote:
> > On Wed, 20 May 2020 17:03:02 -0700 Jacob Keller wrote:
> >> Hi Jiri, Jakub,
> >>
> >> I've been asked to investigate using devlink as a mechanism for
> >> reporting asynchronous events/messages from firmware including
> >> diagnostic messages, etc.
> >>
> >> Essentially, the ice firmware can report various status or diagnostic
> >> messages which are useful for debugging internal behavior. We want to be
> >> able to get these messages (and relevant data associated with them) in a
> >> format beyond just "dump it to the dmesg buffer and recover it later".
> >>
> >> It seems like this would be an appropriate use of devlink. I thought
> >> maybe this would work with devlink health:
> >>
> >> i.e. we create a devlink health reporter, and then when firmware sends a
> >> message, we use devlink_health_report.
> >>
> >> But when I dug into this, it doesn't seem like a natural fit. The health
> >> reporters expect to see an "error" state, and don't seem to really fit
> >> the notion of "log a message from firmware" notion.
> >>
> >> One of the issues is that the health reporter only keeps one dump, when
> >> what we really want is a way to have a monitoring application get the
> >> dump and then store its contents.
> >>
> >> Thoughts on what might make sense for this? It feels like a stretch of
> >> the health interface...
> >>
> >> I mean basically what I am thinking of having is using the devlink_fmsg
> >> interface to just send a netlink message that then gets sent over the
> >> devlink monitor socket and gets dumped immediately.
> >
> > Why does user space need a raw firmware interface in the first place?
> >
> > Examples?
> >
>
> So the ice firmware can optionally send diagnostic debug messages via
> its control queue. The current solutions we've used internally
> essentially hex-dump the binary contents to the kernel log, and then
> these get scraped and converted into a useful format for human consumption.
>
> I'm not 100% of the format, but I know it's based on a decoding file
> that is specific to a given firmware image, and thus attempting to tie
> this into the driver is problematic.
You explained how it works, but not why it's needed :)
> There is also a plan to provide a simpler interface for some of the
> diagnostic messages where a simple bijection between one code to one
> message for a handful of events, like if the link engine can detect a
> known reason why it wasn't able to get link. I suppose these could be
> translated and immediately printed by the driver without a special
> interface.
Petr worked on something similar last year:
https://lore.kernel.org/netdev/cover.1552672441.git.petrm@mellanox.com/
Amit is currently working on a new version based on ethtool (netlink).
next prev parent reply other threads:[~2020-05-21 20:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-21 0:03 devlink interface for asynchronous event/messages from firmware? Jacob Keller
2020-05-21 0:16 ` Jakub Kicinski
2020-05-21 20:22 ` Jacob Keller
2020-05-21 20:52 ` Ido Schimmel [this message]
2020-05-21 20:59 ` Jacob Keller
2020-05-21 21:51 ` Jakub Kicinski
2020-05-21 22:09 ` Jacob Keller
2020-05-21 22:32 ` Ido Schimmel
2020-05-22 11:00 ` Jiri Pirko
2020-05-22 17:46 ` Jakub Kicinski
2020-05-26 21:13 ` Jacob Keller
2020-05-26 21:00 ` Jacob Keller
2020-05-22 11:03 ` Jiri Pirko
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=20200521205213.GA1093714@splinter \
--to=idosch@idosch.org \
--cc=amitc@mellanox.com \
--cc=jacob.e.keller@intel.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=petrm@mellanox.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).