Netdev List
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	pabeni@redhat.com, edumazet@google.com, andrew@lunn.ch,
	vivien.didelot@gmail.com, f.fainelli@gmail.com,
	tariqt@nvidia.com, moshe@nvidia.com, saeedm@nvidia.com
Subject: Re: [patch net-next 6/7] net: dsa: don't do devlink port setup early
Date: Fri, 26 Aug 2022 01:47:24 +0300	[thread overview]
Message-ID: <20220825224724.nwnczlksk3bgg3v3@skbuf> (raw)
In-Reply-To: <20220825103400.1356995-7-jiri@resnulli.us>

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.

  reply	other threads:[~2022-08-25 22:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25 10:33 [patch net-next 0/7] devlink: sanitize per-port region creation/destruction Jiri Pirko
2022-08-25 10:33 ` [patch net-next 1/7] netdevsim: don't re-create dummy region during devlink reload Jiri Pirko
2022-08-25 10:33 ` [patch net-next 2/7] net: devlink: introduce port registered assert helper and use it Jiri Pirko
2022-08-25 10:33 ` [patch net-next 3/7] net: devlink: introduce a flag to indicate devlink port being registered Jiri Pirko
2022-08-25 10:33 ` [patch net-next 4/7] net: devlink: add port_init/fini() helpers to allow pre-register/post-unregister functions Jiri Pirko
2022-08-25 10:33 ` [patch net-next 5/7] net: dsa: move port_setup/teardown to be called outside devlink port registered area Jiri Pirko
2022-08-25 10:33 ` [patch net-next 6/7] net: dsa: don't do devlink port setup early Jiri Pirko
2022-08-25 22:47   ` Vladimir Oltean [this message]
2022-08-26  8:37     ` Jiri Pirko
2022-08-25 10:34 ` [patch net-next 7/7] net: devlink: convert region create/destroy() to be forbidden on registered devlink/port Jiri Pirko
2022-08-25 22:01 ` [patch net-next 0/7] devlink: sanitize per-port region creation/destruction Jakub Kicinski
2022-08-26  8:21   ` Jiri Pirko
2022-08-27  0:22     ` Jakub Kicinski
2022-08-27  7:39       ` 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=20220825224724.nwnczlksk3bgg3v3@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    --cc=vivien.didelot@gmail.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