All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Tobias Waldekranz <tobias@waldekranz.com>
Cc: Ivan Vecera <ivecera@redhat.com>, Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Jiri Pirko <jiri@resnulli.us>, Petr Machata <petrm@nvidia.com>,
	Nikolay Aleksandrov <razor@blackwall.org>,
	bridge@lists.linux-foundation.org,
	Russell King <linux@armlinux.org.uk>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Ido Schimmel <idosch@nvidia.com>,
	netdev@vger.kernel.org, Cooper Lees <me@cooperlees.com>,
	Roopa Prabhu <roopa@nvidia.com>,
	kuba@kernel.org, Matt Johnston <matt@codeconstruct.com.au>,
	davem@davemloft.net, linux-kernel@vger.kernel.org
Subject: Re: [Bridge] [PATCH v2 net-next 10/10] net: dsa: mv88e6xxx: MST Offloading
Date: Thu, 10 Mar 2022 17:33:53 +0200	[thread overview]
Message-ID: <20220310153353.s6dejcapieltpqpu@skbuf> (raw)
In-Reply-To: <20220310152547.etuov6kpqotnyv2p@skbuf>

On Thu, Mar 10, 2022 at 05:25:47PM +0200, Vladimir Oltean wrote:
> > >> +	err = mv88e6xxx_sid_get(chip, attr->orig_dev, vattr->msti, &new_sid);
> > >> +	if (err)
> > >> +		goto unlock;
> > >> +
> > >> +	if (vlan.sid) {
> > >> +		err = mv88e6xxx_sid_put(chip, vlan.sid);
> > >> +		if (err)
> > >> +			goto unlock;
> > >> +	}
> > >> +
> > >> +	vlan.sid = new_sid;
> > >> +	err = mv88e6xxx_vtu_loadpurge(chip, &vlan);
> > >
> > > Maybe you could move mv88e6xxx_sid_put() after this succeeds?
> > 
> > Yep. Also made sure to avoid needless updates of the VTU entry if it
> > already belonged to the correct SID.
> 
> I realize I gave you conflicting advice here, first with inverting the
> refcount_inc() with the refcount_dec(), then with having fast handling
> of noop-changes to vlan.sid. I hope you're able to make some sense out
> of that and avoid the obvious issue with the refcount temporarily
> dropping to zero before going back to 1, which makes the sanity checker
> complain.

Oh wow... I didn't look at the code again, and commented based on a
false memory. Disregard, sorry. You aren't reversing sid_get with sid_put,
nor did I suggest that. There's a lot that happened just in my head,
apparently.

WARNING: multiple messages have this Message-ID (diff)
From: Vladimir Oltean <olteanv@gmail.com>
To: Tobias Waldekranz <tobias@waldekranz.com>
Cc: davem@davemloft.net, kuba@kernel.org,
	Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Jiri Pirko <jiri@resnulli.us>, Ivan Vecera <ivecera@redhat.com>,
	Roopa Prabhu <roopa@nvidia.com>,
	Nikolay Aleksandrov <razor@blackwall.org>,
	Russell King <linux@armlinux.org.uk>,
	Petr Machata <petrm@nvidia.com>, Cooper Lees <me@cooperlees.com>,
	Ido Schimmel <idosch@nvidia.com>,
	Matt Johnston <matt@codeconstruct.com.au>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	bridge@lists.linux-foundation.org
Subject: Re: [PATCH v2 net-next 10/10] net: dsa: mv88e6xxx: MST Offloading
Date: Thu, 10 Mar 2022 17:33:53 +0200	[thread overview]
Message-ID: <20220310153353.s6dejcapieltpqpu@skbuf> (raw)
In-Reply-To: <20220310152547.etuov6kpqotnyv2p@skbuf>

On Thu, Mar 10, 2022 at 05:25:47PM +0200, Vladimir Oltean wrote:
> > >> +	err = mv88e6xxx_sid_get(chip, attr->orig_dev, vattr->msti, &new_sid);
> > >> +	if (err)
> > >> +		goto unlock;
> > >> +
> > >> +	if (vlan.sid) {
> > >> +		err = mv88e6xxx_sid_put(chip, vlan.sid);
> > >> +		if (err)
> > >> +			goto unlock;
> > >> +	}
> > >> +
> > >> +	vlan.sid = new_sid;
> > >> +	err = mv88e6xxx_vtu_loadpurge(chip, &vlan);
> > >
> > > Maybe you could move mv88e6xxx_sid_put() after this succeeds?
> > 
> > Yep. Also made sure to avoid needless updates of the VTU entry if it
> > already belonged to the correct SID.
> 
> I realize I gave you conflicting advice here, first with inverting the
> refcount_inc() with the refcount_dec(), then with having fast handling
> of noop-changes to vlan.sid. I hope you're able to make some sense out
> of that and avoid the obvious issue with the refcount temporarily
> dropping to zero before going back to 1, which makes the sanity checker
> complain.

Oh wow... I didn't look at the code again, and commented based on a
false memory. Disregard, sorry. You aren't reversing sid_get with sid_put,
nor did I suggest that. There's a lot that happened just in my head,
apparently.

  reply	other threads:[~2022-03-10 15:33 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01 10:03 [Bridge] [PATCH v2 net-next 00/10] net: bridge: Multiple Spanning Trees Tobias Waldekranz
2022-03-01 10:03 ` Tobias Waldekranz
2022-03-01 10:03 ` [Bridge] [PATCH v2 net-next 01/10] net: bridge: mst: Multiple Spanning Tree (MST) mode Tobias Waldekranz
2022-03-01 10:03   ` Tobias Waldekranz
2022-03-01 23:01   ` [Bridge] " Nikolay Aleksandrov
2022-03-01 23:01     ` Nikolay Aleksandrov
2022-03-07 14:53     ` [Bridge] " Tobias Waldekranz
2022-03-07 14:53       ` Tobias Waldekranz
2022-03-03 22:28   ` [Bridge] " Vladimir Oltean
2022-03-03 22:28     ` Vladimir Oltean
2022-03-01 10:03 ` [Bridge] [PATCH v2 net-next 02/10] net: bridge: mst: Allow changing a VLAN's MSTI Tobias Waldekranz
2022-03-01 10:03   ` Tobias Waldekranz
2022-03-03 22:27   ` [Bridge] " Vladimir Oltean
2022-03-03 22:27     ` Vladimir Oltean
2022-03-07 14:54     ` [Bridge] " Tobias Waldekranz
2022-03-07 14:54       ` Tobias Waldekranz
2022-03-01 10:03 ` [Bridge] [PATCH v2 net-next 03/10] net: bridge: mst: Support setting and reporting MST port states Tobias Waldekranz
2022-03-01 10:03   ` Tobias Waldekranz
2022-03-01 23:19   ` [Bridge] " Nikolay Aleksandrov
2022-03-01 23:19     ` Nikolay Aleksandrov
2022-03-02  1:53     ` [Bridge] " Roopa Prabhu
2022-03-02  1:53       ` Roopa Prabhu
2022-03-07 15:03       ` [Bridge] " Tobias Waldekranz
2022-03-07 15:03         ` Tobias Waldekranz
2022-03-07 15:00     ` [Bridge] " Tobias Waldekranz
2022-03-07 15:00       ` Tobias Waldekranz
2022-03-07 15:03       ` [Bridge] " Nikolay Aleksandrov
2022-03-07 15:03         ` Nikolay Aleksandrov
2022-03-01 10:03 ` [Bridge] [PATCH v2 net-next 04/10] net: bridge: mst: Notify switchdev drivers of VLAN MSTI migrations Tobias Waldekranz
2022-03-01 10:03   ` Tobias Waldekranz
2022-03-03 20:59   ` [Bridge] " Vladimir Oltean
2022-03-03 20:59     ` Vladimir Oltean
2022-03-08  8:01     ` [Bridge] " Tobias Waldekranz
2022-03-08  8:01       ` Tobias Waldekranz
2022-03-08 17:17       ` [Bridge] " Vladimir Oltean
2022-03-08 17:17         ` Vladimir Oltean
2022-03-09 15:34         ` [Bridge] " Tobias Waldekranz
2022-03-09 15:34           ` Tobias Waldekranz
2022-03-01 10:03 ` [Bridge] [PATCH v2 net-next 05/10] net: bridge: mst: Notify switchdev drivers of MST state changes Tobias Waldekranz
2022-03-01 10:03   ` Tobias Waldekranz
2022-03-01 10:03 ` [Bridge] [PATCH v2 net-next 06/10] net: dsa: Pass VLAN MSTI migration notifications to driver Tobias Waldekranz
2022-03-01 10:03   ` Tobias Waldekranz
2022-03-03 22:29   ` [Bridge] " Vladimir Oltean
2022-03-03 22:29     ` Vladimir Oltean
2022-03-09 15:47     ` [Bridge] " Tobias Waldekranz
2022-03-09 15:47       ` Tobias Waldekranz
2022-03-09 17:03       ` [Bridge] " Vladimir Oltean
2022-03-09 17:03         ` Vladimir Oltean
2022-03-01 10:03 ` [Bridge] [PATCH v2 net-next 07/10] net: dsa: Pass MST state changes " Tobias Waldekranz
2022-03-01 10:03   ` Tobias Waldekranz
2022-03-03 22:20   ` [Bridge] " Vladimir Oltean
2022-03-03 22:20     ` Vladimir Oltean
2022-03-10  8:54     ` [Bridge] " Tobias Waldekranz
2022-03-10  8:54       ` Tobias Waldekranz
2022-03-10 10:35       ` [Bridge] " Vladimir Oltean
2022-03-10 10:35         ` Vladimir Oltean
2022-03-10 16:05         ` [Bridge] " Tobias Waldekranz
2022-03-10 16:05           ` Tobias Waldekranz
2022-03-10 16:18           ` [Bridge] " Vladimir Oltean
2022-03-10 16:18             ` Vladimir Oltean
2022-03-10 22:46             ` [Bridge] " Tobias Waldekranz
2022-03-10 22:46               ` Tobias Waldekranz
2022-03-10 23:08               ` [Bridge] " Vladimir Oltean
2022-03-10 23:08                 ` Vladimir Oltean
2022-03-10 23:59                 ` [Bridge] " Tobias Waldekranz
2022-03-10 23:59                   ` Tobias Waldekranz
2022-03-11  0:22                   ` [Bridge] " Vladimir Oltean
2022-03-11  0:22                     ` Vladimir Oltean
2022-03-11  9:01                     ` [Bridge] " Tobias Waldekranz
2022-03-11  9:01                       ` Tobias Waldekranz
2022-03-10 16:20           ` [Bridge] " Tobias Waldekranz
2022-03-10 16:20             ` Tobias Waldekranz
2022-03-01 10:03 ` [Bridge] [PATCH v2 net-next 08/10] net: dsa: mv88e6xxx: Disentangle STU from VTU Tobias Waldekranz
2022-03-01 10:03   ` Tobias Waldekranz
2022-03-01 10:03 ` [Bridge] [PATCH v2 net-next 09/10] net: dsa: mv88e6xxx: Export STU as devlink region Tobias Waldekranz
2022-03-01 10:03   ` Tobias Waldekranz
2022-03-01 10:03 ` [Bridge] [PATCH v2 net-next 10/10] net: dsa: mv88e6xxx: MST Offloading Tobias Waldekranz
2022-03-01 10:03   ` Tobias Waldekranz
2022-03-03 22:26   ` [Bridge] " Vladimir Oltean
2022-03-03 22:26     ` Vladimir Oltean
2022-03-10 15:14     ` [Bridge] " Tobias Waldekranz
2022-03-10 15:14       ` Tobias Waldekranz
2022-03-10 15:25       ` [Bridge] " Vladimir Oltean
2022-03-10 15:25         ` Vladimir Oltean
2022-03-10 15:33         ` Vladimir Oltean [this message]
2022-03-10 15:33           ` Vladimir Oltean
2022-03-01 16:21 ` [Bridge] [PATCH v2 net-next 00/10] net: bridge: Multiple Spanning Trees Vladimir Oltean
2022-03-01 16:21   ` Vladimir Oltean
2022-03-01 17:19   ` [Bridge] " Stephen Hemminger
2022-03-01 17:19     ` Stephen Hemminger
2022-03-01 21:20   ` [Bridge] " Tobias Waldekranz
2022-03-01 21:20     ` Tobias Waldekranz
2022-03-01 22:30     ` [Bridge] " Pavel Šimerda
2022-03-01 22:30       ` Pavel Šimerda

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=20220310153353.s6dejcapieltpqpu@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=idosch@nvidia.com \
    --cc=ivecera@redhat.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=matt@codeconstruct.com.au \
    --cc=me@cooperlees.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@nvidia.com \
    --cc=razor@blackwall.org \
    --cc=roopa@nvidia.com \
    --cc=tobias@waldekranz.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.