mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-27 01:11:14 +00:00
9664b41c05
Deleted (upstreamed): generic/backport-5.10/610-v5.13-02-netfilter-Fix-fall-through-warnings-for-Clang.patch generic/backport-5.10/792-v5.15-0001-net-dsa-b53-Fix-calculating-number-of-switch-ports.patch generic/backport-5.10/792-v5.15-0002-net-dsa-b53-Set-correct-number-of-ports-in-the-DSA-s.patch generic/backport-5.10/792-v5.15-0003-net-dsa-b53-Fix-IMP-port-setup-on-BCM5301x.patch generic/backport-5.10/840-0001-PCI-of-Don-t-fail-devm_pci_alloc_host_bridge-on-miss.patch generic/backport-5.10/840-0002-PCI-iproc-Fix-BCMA-probe-resource-handling.patch generic/pending-5.10/498-mtd-mtdconcat-select-readwrite-function.patch Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
57 lines
1.8 KiB
Diff
57 lines
1.8 KiB
Diff
From 81e39fd78db82fb51b05fff309b9c521f1a0bc5a Mon Sep 17 00:00:00 2001
|
|
From: Tobias Waldekranz <tobias@waldekranz.com>
|
|
Date: Sat, 16 Jan 2021 02:25:14 +0100
|
|
Subject: [PATCH] net: dsa: Sync static FDB entries on foreign interfaces to
|
|
hardware
|
|
|
|
Reuse the "assisted_learning_on_cpu_port" functionality to always add
|
|
entries for user-configured entries on foreign interfaces, even if
|
|
assisted_learning_on_cpu_port is not enabled. E.g. in this situation:
|
|
|
|
br0
|
|
/ \
|
|
swp0 dummy0
|
|
|
|
$ bridge fdb add 02:00:de:ad:00:01 dev dummy0 vlan 1 master
|
|
|
|
Results in DSA adding an entry in the hardware FDB, pointing this
|
|
address towards the CPU port.
|
|
|
|
The same is true for entries added to the bridge itself, e.g:
|
|
|
|
$ bridge fdb add 02:00:de:ad:00:01 dev br0 vlan 1 self
|
|
|
|
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
|
|
---
|
|
net/dsa/slave.c | 12 ++++++++----
|
|
1 file changed, 8 insertions(+), 4 deletions(-)
|
|
|
|
--- a/net/dsa/slave.c
|
|
+++ b/net/dsa/slave.c
|
|
@@ -2199,9 +2199,12 @@ static int dsa_slave_switchdev_event(str
|
|
else if (!fdb_info->added_by_user)
|
|
return NOTIFY_OK;
|
|
} else {
|
|
- /* Snoop addresses learnt on foreign interfaces
|
|
- * bridged with us, for switches that don't
|
|
- * automatically learn SA from CPU-injected traffic
|
|
+ /* Snoop addresses added to foreign interfaces
|
|
+ * bridged with us, or the bridge
|
|
+ * itself. Dynamically learned addresses can
|
|
+ * also be added for switches that don't
|
|
+ * automatically learn SA from CPU-injected
|
|
+ * traffic.
|
|
*/
|
|
struct net_device *br_dev;
|
|
struct dsa_slave_priv *p;
|
|
@@ -2223,7 +2226,8 @@ static int dsa_slave_switchdev_event(str
|
|
|
|
dp = p->dp->cpu_dp;
|
|
|
|
- if (!dp->ds->assisted_learning_on_cpu_port)
|
|
+ if (!fdb_info->added_by_user &&
|
|
+ !dp->ds->assisted_learning_on_cpu_port)
|
|
return NOTIFY_DONE;
|
|
}
|
|
|