All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tobias Waldekranz <tobias@waldekranz.com>
To: Vladimir Oltean <olteanv@gmail.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 v4 net-next 09/15] net: dsa: Never offload FDB entries on standalone ports
Date: Tue, 15 Mar 2022 23:57:01 +0100	[thread overview]
Message-ID: <875yoelt8i.fsf@waldekranz.com> (raw)
In-Reply-To: <20220315224205.jzz3m2mroytanesh@skbuf>

On Wed, Mar 16, 2022 at 00:42, Vladimir Oltean <olteanv@gmail.com> wrote:
> On Tue, Mar 15, 2022 at 11:26:59PM +0100, Tobias Waldekranz wrote:
>> On Tue, Mar 15, 2022 at 18:33, Vladimir Oltean <olteanv@gmail.com> wrote:
>> > On Tue, Mar 15, 2022 at 01:25:37AM +0100, Tobias Waldekranz wrote:
>> >> If a port joins a bridge that it can't offload, it will fallback to
>> >> standalone mode and software bridging. In this case, we never want to
>> >> offload any FDB entries to hardware either.
>> >> 
>> >> Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
>> >> ---
>> >
>> > When you resend, please send this patch separately, unless something
>> > breaks really ugly with your MST series in place.
>> 
>> Sure. I found this while testing the software fallback. It prevents a
>> segfault in dsa_port_bridge_host_fdb_add, which (rightly, I think)
>> assumes that dp->bridge is valid. I feel like this should have a Fixes:
>> tag, but I'm not sure which commit to blame. Any suggestions?
>
> Ok, makes sense. So far, unoffloaded bridge ports meant that the DSA
> switch driver didn't have a ->port_bridge_join() implementation.
> Presumably that also came along with a missing ->port_fdb_add()
> implementation. So probably no NPD for the existing code paths, it is
> just your unoffloaded MST support that opens up new possibilities.
>
> Anyway, the dereference of dp->bridge first appeared in commit
> c26933639b54 ("net: dsa: request drivers to perform FDB isolation")
> which is still just in net-next.

Thanks, I just sent it separately:

https://lore.kernel.org/netdev/20220315225018.1399269-1-tobias@waldekranz.com

>> >>  net/dsa/slave.c | 3 +++
>> >>  1 file changed, 3 insertions(+)
>> >> 
>> >> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
>> >> index a61a7c54af20..647adee97f7f 100644
>> >> --- a/net/dsa/slave.c
>> >> +++ b/net/dsa/slave.c
>> >> @@ -2624,6 +2624,9 @@ static int dsa_slave_fdb_event(struct net_device *dev,
>> >>  	if (ctx && ctx != dp)
>> >>  		return 0;
>> >>  
>> >> +	if (!dp->bridge)
>> >> +		return 0;
>> >> +
>> >>  	if (switchdev_fdb_is_dynamically_learned(fdb_info)) {
>> >>  		if (dsa_port_offloads_bridge_port(dp, orig_dev))
>> >>  			return 0;
>> >> -- 
>> >> 2.25.1
>> >> 

WARNING: multiple messages have this Message-ID (diff)
From: Tobias Waldekranz <tobias@waldekranz.com>
To: Vladimir Oltean <olteanv@gmail.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>, Ido Schimmel <idosch@nvidia.com>,
	Matt Johnston <matt@codeconstruct.com.au>,
	Cooper Lees <me@cooperlees.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	bridge@lists.linux-foundation.org
Subject: Re: [PATCH v4 net-next 09/15] net: dsa: Never offload FDB entries on standalone ports
Date: Tue, 15 Mar 2022 23:57:01 +0100	[thread overview]
Message-ID: <875yoelt8i.fsf@waldekranz.com> (raw)
In-Reply-To: <20220315224205.jzz3m2mroytanesh@skbuf>

On Wed, Mar 16, 2022 at 00:42, Vladimir Oltean <olteanv@gmail.com> wrote:
> On Tue, Mar 15, 2022 at 11:26:59PM +0100, Tobias Waldekranz wrote:
>> On Tue, Mar 15, 2022 at 18:33, Vladimir Oltean <olteanv@gmail.com> wrote:
>> > On Tue, Mar 15, 2022 at 01:25:37AM +0100, Tobias Waldekranz wrote:
>> >> If a port joins a bridge that it can't offload, it will fallback to
>> >> standalone mode and software bridging. In this case, we never want to
>> >> offload any FDB entries to hardware either.
>> >> 
>> >> Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
>> >> ---
>> >
>> > When you resend, please send this patch separately, unless something
>> > breaks really ugly with your MST series in place.
>> 
>> Sure. I found this while testing the software fallback. It prevents a
>> segfault in dsa_port_bridge_host_fdb_add, which (rightly, I think)
>> assumes that dp->bridge is valid. I feel like this should have a Fixes:
>> tag, but I'm not sure which commit to blame. Any suggestions?
>
> Ok, makes sense. So far, unoffloaded bridge ports meant that the DSA
> switch driver didn't have a ->port_bridge_join() implementation.
> Presumably that also came along with a missing ->port_fdb_add()
> implementation. So probably no NPD for the existing code paths, it is
> just your unoffloaded MST support that opens up new possibilities.
>
> Anyway, the dereference of dp->bridge first appeared in commit
> c26933639b54 ("net: dsa: request drivers to perform FDB isolation")
> which is still just in net-next.

Thanks, I just sent it separately:

https://lore.kernel.org/netdev/20220315225018.1399269-1-tobias@waldekranz.com

>> >>  net/dsa/slave.c | 3 +++
>> >>  1 file changed, 3 insertions(+)
>> >> 
>> >> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
>> >> index a61a7c54af20..647adee97f7f 100644
>> >> --- a/net/dsa/slave.c
>> >> +++ b/net/dsa/slave.c
>> >> @@ -2624,6 +2624,9 @@ static int dsa_slave_fdb_event(struct net_device *dev,
>> >>  	if (ctx && ctx != dp)
>> >>  		return 0;
>> >>  
>> >> +	if (!dp->bridge)
>> >> +		return 0;
>> >> +
>> >>  	if (switchdev_fdb_is_dynamically_learned(fdb_info)) {
>> >>  		if (dsa_port_offloads_bridge_port(dp, orig_dev))
>> >>  			return 0;
>> >> -- 
>> >> 2.25.1
>> >> 

  reply	other threads:[~2022-03-15 22:57 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15  0:25 [Bridge] [PATCH v4 net-next 00/15] net: bridge: Multiple Spanning Trees Tobias Waldekranz
2022-03-15  0:25 ` Tobias Waldekranz
2022-03-15  0:25 ` [Bridge] [PATCH v4 net-next 01/15] net: bridge: mst: Multiple Spanning Tree (MST) mode Tobias Waldekranz
2022-03-15  0:25   ` Tobias Waldekranz
2022-03-15  0:25 ` [Bridge] [PATCH v4 net-next 02/15] net: bridge: mst: Allow changing a VLAN's MSTI Tobias Waldekranz
2022-03-15  0:25   ` Tobias Waldekranz
2022-03-15  0:25 ` [Bridge] [PATCH v4 net-next 03/15] net: bridge: mst: Support setting and reporting MST port states Tobias Waldekranz
2022-03-15  0:25   ` Tobias Waldekranz
2022-03-15  9:52   ` [Bridge] " Nikolay Aleksandrov
2022-03-15  9:52     ` Nikolay Aleksandrov
2022-03-15 16:54   ` [Bridge] " Vladimir Oltean
2022-03-15 16:54     ` Vladimir Oltean
2022-03-15 22:35     ` [Bridge] " Tobias Waldekranz
2022-03-15 22:35       ` Tobias Waldekranz
2022-03-15  0:25 ` [Bridge] [PATCH v4 net-next 04/15] net: bridge: mst: Notify switchdev drivers of MST mode changes Tobias Waldekranz
2022-03-15  0:25   ` Tobias Waldekranz
2022-03-15  5:32   ` [Bridge] " Jakub Kicinski
2022-03-15  5:32     ` Jakub Kicinski
2022-03-15 22:28     ` [Bridge] " Tobias Waldekranz
2022-03-15 22:28       ` Tobias Waldekranz
2022-03-15  0:25 ` [Bridge] [PATCH v4 net-next 05/15] net: bridge: mst: Notify switchdev drivers of VLAN MSTI migrations Tobias Waldekranz
2022-03-15  0:25   ` Tobias Waldekranz
2022-03-15  0:25 ` [Bridge] [PATCH v4 net-next 06/15] net: bridge: mst: Notify switchdev drivers of MST state changes Tobias Waldekranz
2022-03-15  0:25   ` Tobias Waldekranz
2022-03-15  0:25 ` [Bridge] [PATCH v4 net-next 07/15] net: bridge: mst: Add helper to map an MSTI to a VID set Tobias Waldekranz
2022-03-15  0:25   ` Tobias Waldekranz
2022-03-15  0:25 ` [Bridge] [PATCH v4 net-next 08/15] net: bridge: mst: Add helper to check if MST is enabled Tobias Waldekranz
2022-03-15  0:25   ` Tobias Waldekranz
2022-03-15  0:25 ` [Bridge] [PATCH v4 net-next 09/15] net: dsa: Never offload FDB entries on standalone ports Tobias Waldekranz
2022-03-15  0:25   ` Tobias Waldekranz
2022-03-15 16:33   ` [Bridge] " Vladimir Oltean
2022-03-15 16:33     ` Vladimir Oltean
2022-03-15 22:26     ` [Bridge] " Tobias Waldekranz
2022-03-15 22:26       ` Tobias Waldekranz
2022-03-15 22:42       ` [Bridge] " Vladimir Oltean
2022-03-15 22:42         ` Vladimir Oltean
2022-03-15 22:57         ` Tobias Waldekranz [this message]
2022-03-15 22:57           ` Tobias Waldekranz
2022-03-15  0:25 ` [Bridge] [PATCH v4 net-next 10/15] net: dsa: Validate hardware support for MST Tobias Waldekranz
2022-03-15  0:25   ` Tobias Waldekranz
2022-03-15 17:11   ` [Bridge] " Vladimir Oltean
2022-03-15 17:11     ` Vladimir Oltean
2022-03-16  9:15     ` [Bridge] " Tobias Waldekranz
2022-03-16  9:15       ` Tobias Waldekranz
2022-03-16 13:03       ` [Bridge] " Vladimir Oltean
2022-03-16 13:03         ` Vladimir Oltean
2022-03-15  0:25 ` [Bridge] [PATCH v4 net-next 11/15] net: dsa: Pass VLAN MSTI migration notifications to driver Tobias Waldekranz
2022-03-15  0:25   ` Tobias Waldekranz
2022-03-15  0:25 ` [Bridge] [PATCH v4 net-next 12/15] net: dsa: Handle MST state changes Tobias Waldekranz
2022-03-15  0:25   ` Tobias Waldekranz
2022-03-15 16:42   ` [Bridge] " Vladimir Oltean
2022-03-15 16:42     ` Vladimir Oltean
2022-03-15 16:44     ` [Bridge] " Vladimir Oltean
2022-03-15 16:44       ` Vladimir Oltean
2022-03-16  9:45     ` [Bridge] " Tobias Waldekranz
2022-03-16  9:45       ` Tobias Waldekranz
2022-03-16  9:51       ` [Bridge] " Tobias Waldekranz
2022-03-16  9:51         ` Tobias Waldekranz
2022-03-16 13:02         ` [Bridge] " Vladimir Oltean
2022-03-16 13:02           ` Vladimir Oltean
2022-03-15  0:25 ` [Bridge] [PATCH v4 net-next 13/15] net: dsa: mv88e6xxx: Disentangle STU from VTU Tobias Waldekranz
2022-03-15  0:25   ` Tobias Waldekranz
2022-03-15  0:25 ` [Bridge] [PATCH v4 net-next 14/15] net: dsa: mv88e6xxx: Export STU as devlink region Tobias Waldekranz
2022-03-15  0:25   ` Tobias Waldekranz
2022-03-15  0:25 ` [Bridge] [PATCH v4 net-next 15/15] net: dsa: mv88e6xxx: MST Offloading Tobias Waldekranz
2022-03-15  0:25   ` Tobias Waldekranz

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=875yoelt8i.fsf@waldekranz.com \
    --to=tobias@waldekranz.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=olteanv@gmail.com \
    --cc=petrm@nvidia.com \
    --cc=razor@blackwall.org \
    --cc=roopa@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 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.