[PATCH net] net: sparx5/lan969x: don't report host FDB entries to the bridge

Daniel Machon daniel.machon at microchip.com
Fri Dec 4 04:35:18 PST 2026


Since commit 9f01cfbf2922 ("net: sparx5: Use Switchdev fdb events for
managing fdb entries"), the driver handles the FDB events of every
netdev in the system. The entries of a netdev that is not a sparx5 port
are trapped to the CPU as host entries, and, like port entries,
reported back to the bridge with SWITCHDEV_FDB_ADD_TO_BRIDGE on that
netdev.

For a foreign bridge port, such as a veth or tap in the offloaded
bridge, or a port of an unrelated software bridge, the report makes the
bridge entry extern_learn. On a VLAN-unaware bridge, where the driver
maps VID 0 to VID 1, it adds a second, extern_learn entry in VLAN 1
instead. The bridge does not age extern_learn entries, and the driver
never deletes them, so the learned entries of software bridges
accumulate, and `bridge fdb show` lists them as offloaded, although they
are bridged in software.

Only report the entries of sparx5 ports. Host entries are trapped to
the CPU and forwarded by the software bridge, so they are not
offloaded.

The issue was found by Sashiko while preparing LAG support for sparx5
and lan969x. It was reproduced on a lan9698 EV board with a static entry
on a veth in a software bridge, which `bridge fdb show` then lists as
"vlan 1 extern_learn offload":

  ip link add br1 type bridge
  ip link add veth0 type veth peer name veth1
  ip link set veth0 master br1
  ip link set br1 up
  ip link set veth0 up
  bridge fdb add 00:11:22:33:44:55 dev veth0 master static
  bridge fdb show dev veth0

An entry the bridge learns on the veth is listed the same way.

Fixes: 9f01cfbf2922 ("net: sparx5: Use Switchdev fdb events for managing fdb entries")
Signed-off-by: Daniel Machon <daniel.machon at microchip.com>
---
 drivers/net/ethernet/microchip/sparx5/sparx5_mactable.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_mactable.c b/drivers/net/ethernet/microchip/sparx5/sparx5_mactable.c
index 57c58a3544714..391b37fb2c726 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_mactable.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_mactable.c
@@ -327,8 +327,10 @@ int sparx5_add_mact_entry(struct sparx5 *sparx5,
 	/* New entry? */
 	if (mact_entry->flags == 0) {
 		mact_entry->flags |= MAC_ENT_LOCK; /* Don't age this */
-		sparx5_fdb_call_notifiers(SWITCHDEV_FDB_ADD_TO_BRIDGE, addr, vid,
-					  dev, true);
+		/* Host entries are bridged in software, don't report them */
+		if (sparx5_netdevice_check(dev))
+			sparx5_fdb_call_notifiers(SWITCHDEV_FDB_ADD_TO_BRIDGE,
+						  addr, vid, dev, true);
 	}
 
 	return ret;

---
base-commit: 90ae4042bd9f35a9098d14b1a12a43df9b326e2b
change-id: 20261203-sparx5-host-fdb-report-03296dce8606

Best regards,
-- 
Daniel Machon <daniel.machon at microchip.com>




More information about the linux-arm-kernel mailing list