aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
diff options
context:
space:
mode:
authorDENG Qingfang <dqfext@gmail.com>2021-02-22 13:38:11 +0800
committerHauke Mehrtens <hauke@hauke-m.de>2021-02-23 21:10:56 +0100
commit920eaab1d8179035d0ae1047e75cf9a50da6a6eb (patch)
tree14c29956bb33e682f304c643247aa023dd7ec211 /target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
parent90b1524f75023ad0f441e82773ca9e9b5d513e1a (diff)
downloadupstream-920eaab1d8179035d0ae1047e75cf9a50da6a6eb.tar.gz
upstream-920eaab1d8179035d0ae1047e75cf9a50da6a6eb.tar.bz2
upstream-920eaab1d8179035d0ae1047e75cf9a50da6a6eb.zip
kernel: DSA roaming fix for Marvell mv88e6xxx
Marvell mv88e6xxx switch series cannot perform MAC learning from CPU-injected (FROM_CPU) DSA frames, which results in 2 issues. - excessive flooding, due to the fact that DSA treats those addresses as unknown - the risk of stale routes, which can lead to temporary packet loss Backport those patch series from netdev mailing list, which solve these issues by adding and clearing static entries to the switch's FDB. Add a hack patch to set default VID to 1 in port_fdb_{add,del}. Otherwise the static entries will be added to the switch's private FDB if VLAN filtering disabled, which will not work. The switch may generate an "ATU violation" warning when a client moves from the CPU port to a switch port because the static ATU entry added by DSA core still points to the CPU port. DSA core will then clear the static entry so it is not fatal. Disable the warning so it will not confuse users. Link: https://lore.kernel.org/netdev/20210106095136.224739-1-olteanv@gmail.com/ Link: https://lore.kernel.org/netdev/20210116012515.3152-1-tobias@waldekranz.com/ Ref: https://gitlab.nic.cz/turris/turris-build/-/issues/165 Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Diffstat (limited to 'target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch')
-rw-r--r--target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch b/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
new file mode 100644
index 0000000000..cbf2739469
--- /dev/null
+++ b/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
@@ -0,0 +1,42 @@
+From 5fb4a451a87d8ed3363d28b63a3295399373d6c4 Mon Sep 17 00:00:00 2001
+From: Vladimir Oltean <vladimir.oltean@nxp.com>
+Date: Wed, 6 Jan 2021 11:51:34 +0200
+Subject: [PATCH] net: dsa: exit early in dsa_slave_switchdev_event if we can't
+ program the FDB
+
+Right now, the following would happen for a switch driver that does not
+implement .port_fdb_add or .port_fdb_del.
+
+dsa_slave_switchdev_event returns NOTIFY_OK and schedules:
+-> dsa_slave_switchdev_event_work
+ -> dsa_port_fdb_add
+ -> dsa_port_notify(DSA_NOTIFIER_FDB_ADD)
+ -> dsa_switch_fdb_add
+ -> if (!ds->ops->port_fdb_add) return -EOPNOTSUPP;
+ -> an error is printed with dev_dbg, and
+ dsa_fdb_offload_notify(switchdev_work) is not called.
+
+We can avoid scheduling the worker for nothing and say NOTIFY_DONE.
+Because we don't call dsa_fdb_offload_notify, the static FDB entry will
+remain just in the software bridge.
+
+Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
+Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
+Reviewed-by: Andrew Lunn <andrew@lunn.ch>
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+---
+ net/dsa/slave.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/net/dsa/slave.c
++++ b/net/dsa/slave.c
+@@ -2090,6 +2090,9 @@ static int dsa_slave_switchdev_event(str
+
+ dp = dsa_slave_to_port(dev);
+
++ if (!dp->ds->ops->port_fdb_add || !dp->ds->ops->port_fdb_del)
++ return NOTIFY_DONE;
++
+ switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC);
+ if (!switchdev_work)
+ return NOTIFY_BAD;