920eaab1d8
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>
76 lines
2.3 KiB
Diff
76 lines
2.3 KiB
Diff
From 46fe6cecb296d850c1ee2b333e57093ac4b733f3 Mon Sep 17 00:00:00 2001
|
|
From: Tobias Waldekranz <tobias@waldekranz.com>
|
|
Date: Sat, 16 Jan 2021 02:25:09 +0100
|
|
Subject: [PATCH] net: bridge: switchdev: Refactor br_switchdev_fdb_notify
|
|
|
|
Instead of having to add more and more arguments to
|
|
br_switchdev_fdb_call_notifiers, get rid of it and build the info
|
|
struct directly in br_switchdev_fdb_notify.
|
|
|
|
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
|
|
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
|
|
---
|
|
net/bridge/br_switchdev.c | 41 +++++++++++----------------------------
|
|
1 file changed, 11 insertions(+), 30 deletions(-)
|
|
|
|
--- a/net/bridge/br_switchdev.c
|
|
+++ b/net/bridge/br_switchdev.c
|
|
@@ -102,46 +102,27 @@ int br_switchdev_set_port_flag(struct ne
|
|
return 0;
|
|
}
|
|
|
|
-static void
|
|
-br_switchdev_fdb_call_notifiers(bool adding, const unsigned char *mac,
|
|
- u16 vid, struct net_device *dev,
|
|
- bool added_by_user, bool offloaded)
|
|
-{
|
|
- struct switchdev_notifier_fdb_info info;
|
|
- unsigned long notifier_type;
|
|
-
|
|
- info.addr = mac;
|
|
- info.vid = vid;
|
|
- info.added_by_user = added_by_user;
|
|
- info.offloaded = offloaded;
|
|
- notifier_type = adding ? SWITCHDEV_FDB_ADD_TO_DEVICE : SWITCHDEV_FDB_DEL_TO_DEVICE;
|
|
- call_switchdev_notifiers(notifier_type, dev, &info.info, NULL);
|
|
-}
|
|
-
|
|
void
|
|
br_switchdev_fdb_notify(const struct net_bridge_fdb_entry *fdb, int type)
|
|
{
|
|
+ struct switchdev_notifier_fdb_info info = {
|
|
+ .addr = fdb->key.addr.addr,
|
|
+ .vid = fdb->key.vlan_id,
|
|
+ .added_by_user = test_bit(BR_FDB_ADDED_BY_USER, &fdb->flags),
|
|
+ .offloaded = test_bit(BR_FDB_OFFLOADED, &fdb->flags),
|
|
+ };
|
|
+
|
|
if (!fdb->dst)
|
|
return;
|
|
|
|
switch (type) {
|
|
case RTM_DELNEIGH:
|
|
- br_switchdev_fdb_call_notifiers(false, fdb->key.addr.addr,
|
|
- fdb->key.vlan_id,
|
|
- fdb->dst->dev,
|
|
- test_bit(BR_FDB_ADDED_BY_USER,
|
|
- &fdb->flags),
|
|
- test_bit(BR_FDB_OFFLOADED,
|
|
- &fdb->flags));
|
|
+ call_switchdev_notifiers(SWITCHDEV_FDB_DEL_TO_DEVICE,
|
|
+ fdb->dst->dev, &info.info, NULL);
|
|
break;
|
|
case RTM_NEWNEIGH:
|
|
- br_switchdev_fdb_call_notifiers(true, fdb->key.addr.addr,
|
|
- fdb->key.vlan_id,
|
|
- fdb->dst->dev,
|
|
- test_bit(BR_FDB_ADDED_BY_USER,
|
|
- &fdb->flags),
|
|
- test_bit(BR_FDB_OFFLOADED,
|
|
- &fdb->flags));
|
|
+ call_switchdev_notifiers(SWITCHDEV_FDB_ADD_TO_DEVICE,
|
|
+ fdb->dst->dev, &info.info, NULL);
|
|
break;
|
|
}
|
|
}
|