netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Ido Schimmel <idosch@idosch.org>
Cc: netdev@vger.kernel.org, davem@davemloft.net, jiri@mellanox.com,
	shalomt@mellanox.com, mlxsw@mellanox.com,
	Ido Schimmel <idosch@mellanox.com>
Subject: Re: [PATCH net-next 0/6] mlxsw: Add extended ACK for EMADs
Date: Mon, 4 Nov 2019 14:44:19 -0800	[thread overview]
Message-ID: <20191104144419.46e304a9@cakuba.netronome.com> (raw)
In-Reply-To: <20191104210450.GA10713@splinter>

On Mon, 4 Nov 2019 23:04:50 +0200, Ido Schimmel wrote:
> On Mon, Nov 04, 2019 at 12:39:54PM -0800, Jakub Kicinski wrote:
> > On Sun,  3 Nov 2019 10:35:48 +0200, Ido Schimmel wrote:  
> > > From: Ido Schimmel <idosch@mellanox.com>
> > > 
> > > Ethernet Management Datagrams (EMADs) are Ethernet packets sent between
> > > the driver and device's firmware. They are used to pass various
> > > configurations to the device, but also to get events (e.g., port up)
> > > from it. After the Ethernet header, these packets are built in a TLV
> > > format.
> > > 
> > > Up until now, whenever the driver issued an erroneous register access it
> > > only got an error code indicating a bad parameter was used. This patch
> > > set from Shalom adds a new TLV (string TLV) that can be used by the
> > > firmware to encode a 128 character string describing the error. The new
> > > TLV is allocated by the driver and set to zeros. In case of error, the
> > > driver will check the length of the string in the response and print it
> > > to the kernel log.
> > > 
> > > Example output:
> > > 
> > > mlxsw_spectrum 0000:03:00.0: EMAD reg access failed (tid=a9719f9700001306,reg_id=8018(rauhtd),type=query,status=7(bad parameter))
> > > mlxsw_spectrum 0000:03:00.0: Firmware error (tid=a9719f9700001306,emad_err_string=inside er_rauhtd_write_query(), num_rec=32 is over the maximum number of records supported)  
> > 
> > Personally I'm not a big fan of passing unstructured data between user
> > and firmware. Not having access to the errors makes it harder to create
> > common interfaces by inspecting driver code.  
> 
> I don't understand the problem. If we get an error from firmware today,
> we have no clue what the actual problem is. With this we can actually
> understand what went wrong. How is it different from kernel passing a
> string ("unstructured data") to user space in response to an erroneous
> netlink request? Obviously it's much better than an "-EINVAL".

The difference is obviously that I can look at the code in the kernel
and understand it. FW code is a black box. Kernel should abstract its
black boxiness away.

> Also, in case it was not clear, this is a read-only interface and only
> from firmware to kernel. No hidden knobs or something fishy like that.

I'm not saying it's fishy, I'm saying it's way harder to refactor code
if some of the user-visible outputs are not accessible (i.e. hidden in
a binary blob).

> > Is there any precedent in the tree for printing FW errors into the logs
> > like this?  
> 
> The mlx5 driver prints a unique number for each firmware error. We tried
> to do the same in switch firmware, but it lacked the infrastructure so
> we decided on this solution instead. It achieves the same goal, but in a
> different way.

FWIW nfp FW also passes error numbers to the driver and based on that
driver makes decisions and prints errors of its own choosing. The big
difference being you can see all the relevant errors by looking at
driver code.

  reply	other threads:[~2019-11-04 22:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-03  8:35 [PATCH net-next 0/6] mlxsw: Add extended ACK for EMADs Ido Schimmel
2019-11-03  8:35 ` [PATCH net-next 1/6] mlxsw: core: Parse TLVs' offsets of incoming EMADs Ido Schimmel
2019-11-03  8:35 ` [PATCH net-next 2/6] mlxsw: emad: Remove deprecated EMAD TLVs Ido Schimmel
2019-11-03  8:35 ` [PATCH net-next 3/6] mlxsw: core: Add EMAD string TLV Ido Schimmel
2019-11-03  8:35 ` [PATCH net-next 4/6] mlxsw: core: Add support for EMAD string TLV parsing Ido Schimmel
2019-11-03  8:35 ` [PATCH net-next 5/6] mlxsw: core: Add support for using EMAD string TLV Ido Schimmel
2019-11-03  8:35 ` [PATCH net-next 6/6] mlxsw: spectrum: Enable " Ido Schimmel
2019-11-04 20:39 ` [PATCH net-next 0/6] mlxsw: Add extended ACK for EMADs Jakub Kicinski
2019-11-04 21:04   ` Ido Schimmel
2019-11-04 22:44     ` Jakub Kicinski [this message]
2019-11-04 23:20       ` Ido Schimmel
2019-11-04 23:33         ` Jakub Kicinski
2019-11-05  7:46           ` Ido Schimmel
2019-11-05 17:54             ` Jakub Kicinski
2019-11-05 20:48               ` Ido Schimmel
2019-11-05 21:48                 ` Jakub Kicinski
2019-11-06  8:20                   ` Jiri Pirko
2019-11-06 17:26                     ` Jakub Kicinski
2019-11-07  9:42                       ` Jiri Pirko
2019-11-06  1:58               ` 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=20191104144419.46e304a9@cakuba.netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=davem@davemloft.net \
    --cc=idosch@idosch.org \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=shalomt@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).