mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 22:23:27 +00:00
02026d0a6f
Deleted (upstreamed): bcm27xx/patches-5.10/950-0145-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch [1] Manually rebased: bcm27xx/patches-5.10/950-0355-xhci-quirks-add-link-TRB-quirk-for-VL805.patch bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch Note: although automatically rebaseable, the last patch has been edited to avoid conflicting bit definitions. [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=b6f32897af190d4716412e156ee0abcc16e4f1e5 Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
97 lines
3.2 KiB
Diff
97 lines
3.2 KiB
Diff
From 2e50fd9322047253c327550b4485cf8761035a8c Mon Sep 17 00:00:00 2001
|
|
From: Tobias Waldekranz <tobias@waldekranz.com>
|
|
Date: Sat, 16 Jan 2021 02:25:11 +0100
|
|
Subject: [PATCH] net: bridge: switchdev: Send FDB notifications for host
|
|
addresses
|
|
|
|
Treat addresses added to the bridge itself in the same way as regular
|
|
ports and send out a notification so that drivers may sync it down to
|
|
the hardware FDB.
|
|
|
|
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
|
|
---
|
|
net/bridge/br_fdb.c | 4 ++--
|
|
net/bridge/br_private.h | 7 ++++---
|
|
net/bridge/br_switchdev.c | 11 +++++------
|
|
3 files changed, 11 insertions(+), 11 deletions(-)
|
|
|
|
--- a/net/bridge/br_fdb.c
|
|
+++ b/net/bridge/br_fdb.c
|
|
@@ -602,7 +602,7 @@ void br_fdb_update(struct net_bridge *br
|
|
/* fastpath: update of existing entry */
|
|
if (unlikely(source != fdb->dst &&
|
|
!test_bit(BR_FDB_STICKY, &fdb->flags))) {
|
|
- br_switchdev_fdb_notify(fdb, RTM_DELNEIGH);
|
|
+ br_switchdev_fdb_notify(br, fdb, RTM_DELNEIGH);
|
|
fdb->dst = source;
|
|
fdb_modified = true;
|
|
/* Take over HW learned entry */
|
|
@@ -735,7 +735,7 @@ static void fdb_notify(struct net_bridge
|
|
int err = -ENOBUFS;
|
|
|
|
if (swdev_notify)
|
|
- br_switchdev_fdb_notify(fdb, type);
|
|
+ br_switchdev_fdb_notify(br, fdb, type);
|
|
|
|
skb = nlmsg_new(fdb_nlmsg_size(), GFP_ATOMIC);
|
|
if (skb == NULL)
|
|
--- a/net/bridge/br_private.h
|
|
+++ b/net/bridge/br_private.h
|
|
@@ -1525,8 +1525,8 @@ bool nbp_switchdev_allowed_egress(const
|
|
int br_switchdev_set_port_flag(struct net_bridge_port *p,
|
|
unsigned long flags,
|
|
unsigned long mask);
|
|
-void br_switchdev_fdb_notify(const struct net_bridge_fdb_entry *fdb,
|
|
- int type);
|
|
+void br_switchdev_fdb_notify(struct net_bridge *br,
|
|
+ const struct net_bridge_fdb_entry *fdb, int type);
|
|
int br_switchdev_port_vlan_add(struct net_device *dev, u16 vid, u16 flags,
|
|
struct netlink_ext_ack *extack);
|
|
int br_switchdev_port_vlan_del(struct net_device *dev, u16 vid);
|
|
@@ -1572,7 +1572,8 @@ static inline int br_switchdev_port_vlan
|
|
}
|
|
|
|
static inline void
|
|
-br_switchdev_fdb_notify(const struct net_bridge_fdb_entry *fdb, int type)
|
|
+br_switchdev_fdb_notify(struct net_bridge *br,
|
|
+ const struct net_bridge_fdb_entry *fdb, int type)
|
|
{
|
|
}
|
|
|
|
--- a/net/bridge/br_switchdev.c
|
|
+++ b/net/bridge/br_switchdev.c
|
|
@@ -103,7 +103,8 @@ int br_switchdev_set_port_flag(struct ne
|
|
}
|
|
|
|
void
|
|
-br_switchdev_fdb_notify(const struct net_bridge_fdb_entry *fdb, int type)
|
|
+br_switchdev_fdb_notify(struct net_bridge *br,
|
|
+ const struct net_bridge_fdb_entry *fdb, int type)
|
|
{
|
|
struct switchdev_notifier_fdb_info info = {
|
|
.addr = fdb->key.addr.addr,
|
|
@@ -112,20 +113,19 @@ br_switchdev_fdb_notify(const struct net
|
|
.local = test_bit(BR_FDB_LOCAL, &fdb->flags),
|
|
.offloaded = test_bit(BR_FDB_OFFLOADED, &fdb->flags),
|
|
};
|
|
+ struct net_device *dev = fdb->dst ? fdb->dst->dev : br->dev;
|
|
|
|
- if (!fdb->dst)
|
|
- return;
|
|
if (test_bit(BR_FDB_LOCAL, &fdb->flags))
|
|
return;
|
|
|
|
switch (type) {
|
|
case RTM_DELNEIGH:
|
|
call_switchdev_notifiers(SWITCHDEV_FDB_DEL_TO_DEVICE,
|
|
- fdb->dst->dev, &info.info, NULL);
|
|
+ dev, &info.info, NULL);
|
|
break;
|
|
case RTM_NEWNEIGH:
|
|
call_switchdev_notifiers(SWITCHDEV_FDB_ADD_TO_DEVICE,
|
|
- fdb->dst->dev, &info.info, NULL);
|
|
+ dev, &info.info, NULL);
|
|
break;
|
|
}
|
|
}
|