All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Daniel Machon <daniel.machon@microchip.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	UNGLinuxDriver@microchip.com,
	Steen Hegelund <steen.hegelund@microchip.com>,
	jacob.e.keller@intel.com, netdev@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: sparx5/lan969x: fix flooding configuration on bridge join/leave
Date: Sat, 4 Oct 2025 10:28:31 +0100	[thread overview]
Message-ID: <20251004092831.GA3060232@horms.kernel.org> (raw)
In-Reply-To: <20251003-fix-flood-fwd-v1-1-48eb478b2904@microchip.com>

On Fri, Oct 03, 2025 at 02:35:59PM +0200, Daniel Machon wrote:
> The sparx5 driver programs UC/MC/BC flooding in sparx5_update_fwd() by
> unconditionally applying bridge_fwd_mask to all flood PGIDs. Any bridge
> topology change that triggers sparx5_update_fwd() (for example enslaving
> another port) therefore reinstalls flooding in hardware for already
> bridged ports, regardless of their per-port flood flags.
> 
> This results in clobbering of the flood masks, and desynchronization
> between software and hardware: the bridge still reports “flood off” for
> the port, but hardware has flooding enabled due to unconditional PGID
> reprogramming.
> 
> Steps to reproduce:
> 
>     $ ip link add br0 type bridge
>     $ ip link set br0 up
>     $ ip link set eth0 master br0
>     $ ip link set eth0 up
>     $ bridge link set dev eth0 flood off
>     $ ip link set eth1 master br0
>     $ ip link set eth1 up
> 
> At this point, flooding is silently re-enabled for eth0. Software still
> shows “flood off” for eth0, but hardware has flooding enabled.
> 
> To fix this, flooding is now set explicitly during bridge join/leave,
> through sparx5_port_attr_bridge_flags():
> 
>     On bridge join, UC/MC/BC flooding is enabled by default.
> 
>     On bridge leave, UC/MC/BC flooding is disabled.
> 
>     sparx5_update_fwd() no longer touches the flood PGIDs, clobbering
>     the flood masks, and desynchronizing software and hardware.
> 
>     Initialization of the flooding PGIDs have been moved to
>     sparx5_start(). This is required as flooding PGIDs defaults to
>     0x3fffffff in hardware and the initialization was previously handled
>     in sparx5_update_fwd(), which was removed.
> 
> With this change, user-configured flooding flags persist across bridge
> updates and are no longer overridden by sparx5_update_fwd().
> 
> Fixes: d6fce5141929 ("net: sparx5: add switching support")
> Signed-off-by: Daniel Machon <daniel.machon@microchip.com>

Reviewed-by: Simon Horman <horms@kernel.org>



  reply	other threads:[~2025-10-04  9:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-03 12:35 [PATCH net] net: sparx5/lan969x: fix flooding configuration on bridge join/leave Daniel Machon
2025-10-04  9:28 ` Simon Horman [this message]
2025-10-07 10:00 ` patchwork-bot+netdevbpf

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=20251004092831.GA3060232@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=daniel.machon@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=steen.hegelund@microchip.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.