Files
openwrt/target/linux/generic/pending-6.18/711-04-net-dsa-qca8k-merge-host-fdb-for-multi-cpu.patch
T
John Audia 238f9b657b kernel: refresh patches for 6.18.20
Sole patch automatically rebased.

Build system: x86/64
Build-tested: x86/64-glibc
Run-tested: x86/64-glibc

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/22643
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-03-28 12:24:19 +01:00

48 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Kevin Staley <glaciertablet@gmail.com>
Date: Mon, 29 Dec 2025 00:00:00 +0000
Subject: [PATCH] net: dsa: qca8k: merge host FDB for multi-CPU setups
In multi-CPU-port setups, DSA may install the same host FDB entry on
multiple upstream-facing ports when bridged user ports use different
conduits. qca8k_port_fdb_add currently overwrites any existing entry for
the same {MAC, VID}, so the last CPU port wins and host reachability can
break for ports serviced by the other CPU port (e.g. Netgear R7800 when
wan is bridged into br-lan).
Use the existing search-and-insert/delete helpers for CPU and DSA ports
so the destination port mask is merged instead of replaced.
Fixes: openwrt/openwrt#17891
Signed-off-by: Kevin Staley <glaciertablet@gmail.com>
---
drivers/net/dsa/qca/qca8k-common.c | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/drivers/net/dsa/qca/qca8k-common.c
+++ b/drivers/net/dsa/qca/qca8k-common.c
@@ -829,6 +829,13 @@ int qca8k_port_fdb_add(struct dsa_switch
struct qca8k_priv *priv = ds->priv;
u16 port_mask = BIT(port);
+ if (!vid)
+ vid = QCA8K_PORT_VID_DEF;
+
+ if (dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port))
+ return qca8k_fdb_search_and_insert(priv, BIT(port), addr, vid,
+ QCA8K_ATU_STATUS_STATIC);
+
return qca8k_port_fdb_insert(priv, addr, port_mask, vid);
}
@@ -842,6 +849,9 @@ int qca8k_port_fdb_del(struct dsa_switch
if (!vid)
vid = QCA8K_PORT_VID_DEF;
+ if (dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port))
+ return qca8k_fdb_search_and_del(priv, BIT(port), addr, vid);
+
return qca8k_fdb_del(priv, addr, port_mask, vid);
}