[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220825224724.nwnczlksk3bgg3v3@skbuf>
Date: Fri, 26 Aug 2022 01:47:24 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: Jiri Pirko <jiri@...nulli.us>
Cc: netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
pabeni@...hat.com, edumazet@...gle.com, andrew@...n.ch,
vivien.didelot@...il.com, f.fainelli@...il.com, tariqt@...dia.com,
moshe@...dia.com, saeedm@...dia.com
Subject: Re: [patch net-next 6/7] net: dsa: don't do devlink port setup early
On Thu, Aug 25, 2022 at 12:33:59PM +0200, Jiri Pirko wrote:
> Note there is no longer needed to reinit port as unused if
> dsa_port_setup() fails, as it unregisters the devlink port instance on
> the error path.
> @@ -957,8 +941,6 @@ static void dsa_switch_teardown(struct dsa_switch *ds)
> dsa_switch_unregister_notifier(ds);
>
> if (ds->devlink) {
> - dsa_switch_for_each_port(dp, ds)
> - dsa_port_devlink_teardown(dp);
> devlink_free(ds->devlink);
> ds->devlink = NULL;
> }
> @@ -1010,11 +992,8 @@ static int dsa_tree_setup_ports(struct dsa_switch_tree *dst)
> list_for_each_entry(dp, &dst->ports, list) {
> if (dsa_port_is_user(dp) || dsa_port_is_unused(dp)) {
> err = dsa_port_setup(dp);
> - if (err) {
> - err = dsa_port_reinit_as_unused(dp);
> - if (err)
> - goto teardown;
> - }
> + if (err)
> + goto teardown;
> }
> }
Please don't delete this, there is still a need.
First of all, dsa_port_setup() for user ports must not fail the probing
of the switch - see commit 86f8b1c01a0a ("net: dsa: Do not make user
port errors fatal").
Also, DSA exposes devlink regions for unused ports too - those have the
{DSA_PORT_TYPE,DEVLINK_PORT_FLAVOUR}_UNUSED flavor.
I also see some weird behavior when I intentionally break the probing of
some ports, but I haven't debugged to see exactly why, and it's likely
I won't have time to debug this week.
Powered by blists - more mailing lists