netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>,
	netdev@vger.kernel.org, Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Kevin Hilman <khilman@kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [RFC PATCH net-next 00/10] Use robust notifiers in DSA
Date: Fri, 19 Aug 2022 03:13:55 +0300	[thread overview]
Message-ID: <20220819001355.7kw6rm5bf257huc2@skbuf> (raw)
In-Reply-To: <Yv6+m7T4HqYnYoDm@lunn.ch>

On Fri, Aug 19, 2022 at 12:35:07AM +0200, Andrew Lunn wrote:
> > So you think that rollback at the cross-chip notifier layer is a new
> > problem we need to tackle, because we don't have enough transactional
> > layering in the code?
> 
> No, i don't think it is a new problem, but it might help explain why
> you don't feel quite right about it. Some errors we simply don't care
> about because we cannot do anything about it. Other errors we should
> try to rollback, and hence need robust notifiers for those errors.

So most of the actual errors I've had to handle in the kernel were
caused by half the code (the callee) expecting one thing, and half the
code (the caller) providing another. That doesn't fit well in neither of
your categories, but it's more like how to best treat the unexpected.
And I'm not talking unexpected as in

  switchdev                               dsa
----------------------------------------------------------------------

- Please add MAC 00:01:02:03:04:05
  to the FDB
                                       - Whoa, after all these years, I
                                         never knew you could speak!

but rather

  switchdev                               dsa
----------------------------------------------------------------------

- Please add MAC 00:01:02:03:04:05
  to the FDB
                                       - Sure thing, man!

- Please delete MAC 00:01:02:03:04:05
  from the FDB
                                       - Aye!

- Please delete MAC 00:01:02:03:04:05
  from the FDB
                                       - Wait, what MAC 00:01:02:03:04:05?
                                         I have no such thing!
- Wha?
                                       - Wha?

There's nothing to do about that except to wait for Mr Developer to come
and debug, and the severity of the problem might be low even though the
problem is just as intractable programmatically as a hardware I/O error.
Nonetheless it's still indicative of a problem worth propagating as high
as possible, because one side of the code had expectations of what the
other side could do that were clearly violated, so their models of the
other side are wrong.

This patch set makes that worse for Mr Developer that gets to debug,
because it makes dsa_port_fdb_del() return void, and the errors will now
get reported to the console at the level of dsa_port_notify() and then
suppressed. dsa_port_notify(), being at the low cross-chip notifier
level, won't print all the gory details of the FDB entry that failed to
be deleted and on what port, it will just say that the operation failed
and return void.

That's what felt wrong for me doing this conversion.

      reply	other threads:[~2022-08-19  0:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18 15:49 [RFC PATCH net-next 00/10] Use robust notifiers in DSA Vladimir Oltean
2022-08-18 15:49 ` [RFC PATCH net-next 01/10] notifier: allow robust variants to take a different void *v argument on rollback Vladimir Oltean
2022-08-18 15:49 ` [RFC PATCH net-next 02/10] net: dsa: introduce and use robust form of dsa_tree_notify() Vladimir Oltean
2022-08-18 15:49 ` [RFC PATCH net-next 03/10] net: dsa: introduce and use robust form of dsa_broadcast() Vladimir Oltean
2022-08-18 15:49 ` [RFC PATCH net-next 04/10] net: dsa: introduce and use robust form of dsa_port_notify() Vladimir Oltean
2022-08-18 15:49 ` [RFC PATCH net-next 05/10] Revert "net: dsa: felix: suppress non-changes to the tagging protocol" Vladimir Oltean
2022-08-18 15:49 ` [RFC PATCH net-next 06/10] net: dsa: convert switch.c functions to return void if they can Vladimir Oltean
2022-08-18 15:49 ` [RFC PATCH net-next 07/10] net: dsa: remove "breaking chain" comment from dsa_switch_event Vladimir Oltean
2022-08-18 15:49 ` [RFC PATCH net-next 08/10] net: dsa: introduce a robust form of MTU cross-chip notifiers Vladimir Oltean
2022-08-18 15:49 ` [RFC PATCH net-next 09/10] net: dsa: make dsa_tree_notify() and derivatives return void Vladimir Oltean
2022-08-18 15:49 ` [RFC PATCH net-next 10/10] net: dsa: make _del variants of functions " Vladimir Oltean
2022-08-18 21:49 ` [RFC PATCH net-next 00/10] Use robust notifiers in DSA Andrew Lunn
2022-08-18 22:28   ` Vladimir Oltean
2022-08-18 22:35     ` Andrew Lunn
2022-08-19  0:13       ` Vladimir Oltean [this message]

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=20220819001355.7kw6rm5bf257huc2@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=khilman@kernel.org \
    --cc=kuba@kernel.org \
    --cc=len.brown@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=rafael@kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=vivien.didelot@gmail.com \
    --cc=vladimir.oltean@nxp.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).