From 8ecd305ff1a53995b884df231533736929eb8f5d Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Mon, 15 Nov 2021 19:57:47 -0500 Subject: [PATCH] Drop net-dsa-flush-switchdev-workqueue-when-leaving-the-b.patch Signed-off-by: Sasha Levin --- ...itchdev-workqueue-when-leaving-the-b.patch | 81 ------------------- queue-5.15/series | 1 - 2 files changed, 82 deletions(-) delete mode 100644 queue-5.15/net-dsa-flush-switchdev-workqueue-when-leaving-the-b.patch diff --git a/queue-5.15/net-dsa-flush-switchdev-workqueue-when-leaving-the-b.patch b/queue-5.15/net-dsa-flush-switchdev-workqueue-when-leaving-the-b.patch deleted file mode 100644 index c5d0c6be8dd..00000000000 --- a/queue-5.15/net-dsa-flush-switchdev-workqueue-when-leaving-the-b.patch +++ /dev/null @@ -1,81 +0,0 @@ -From adb6e98a98eb5504594d0d0f767637b20c9ccf0d Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 26 Oct 2021 12:25:55 +0300 -Subject: net: dsa: flush switchdev workqueue when leaving the bridge - -From: Vladimir Oltean - -[ Upstream commit d7d0d423dbaa73fd0506e25971dfdab6bf185d00 ] - -DSA is preparing to offer switch drivers an API through which they can -associate each FDB entry with a struct net_device *bridge_dev. This can -be used to perform FDB isolation (the FDB lookup performed on the -ingress of a standalone, or bridged port, should not find an FDB entry -that is present in the FDB of another bridge). - -In preparation of that work, DSA needs to ensure that by the time we -call the switch .port_fdb_add and .port_fdb_del methods, the -dp->bridge_dev pointer is still valid, i.e. the port is still a bridge -port. - -This is not guaranteed because the SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE API -requires drivers that must have sleepable context to handle those events -to schedule the deferred work themselves. DSA does this through the -dsa_owq. - -It can happen that a port leaves a bridge, del_nbp() flushes the FDB on -that port, SWITCHDEV_FDB_DEL_TO_DEVICE is notified in atomic context, -DSA schedules its deferred work, but del_nbp() finishes unlinking the -bridge as a master from the port before DSA's deferred work is run. - -Fundamentally, the port must not be unlinked from the bridge until all -FDB deletion deferred work items have been flushed. The bridge must wait -for the completion of these hardware accesses. - -An attempt has been made to address this issue centrally in switchdev by -making SWITCHDEV_FDB_DEL_TO_DEVICE deferred (=> blocking) at the switchdev -level, which would offer implicit synchronization with del_nbp: - -https://patchwork.kernel.org/project/netdevbpf/cover/20210820115746.3701811-1-vladimir.oltean@nxp.com/ - -but it seems that any attempt to modify switchdev's behavior and make -the events blocking there would introduce undesirable side effects in -other switchdev consumers. - -The most undesirable behavior seems to be that -switchdev_deferred_process_work() takes the rtnl_mutex itself, which -would be worse off than having the rtnl_mutex taken individually from -drivers which is what we have now (except DSA which has removed that -lock since commit 0faf890fc519 ("net: dsa: drop rtnl_lock from -dsa_slave_switchdev_event_work")). - -So to offer the needed guarantee to DSA switch drivers, I have come up -with a compromise solution that does not require switchdev rework: -we already have a hook at the last moment in time when the bridge is -still an upper of ours: the NETDEV_PRECHANGEUPPER handler. We can flush -the dsa_owq manually from there, which makes all FDB deletions -synchronous. - -Signed-off-by: Vladimir Oltean -Signed-off-by: David S. Miller -Signed-off-by: Sasha Levin ---- - net/dsa/port.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/net/dsa/port.c b/net/dsa/port.c -index 616330a16d319..3947537ed46ba 100644 ---- a/net/dsa/port.c -+++ b/net/dsa/port.c -@@ -380,6 +380,8 @@ void dsa_port_pre_bridge_leave(struct dsa_port *dp, struct net_device *br) - switchdev_bridge_port_unoffload(brport_dev, dp, - &dsa_slave_switchdev_notifier, - &dsa_slave_switchdev_blocking_notifier); -+ -+ dsa_flush_workqueue(); - } - - void dsa_port_bridge_leave(struct dsa_port *dp, struct net_device *br) --- -2.33.0 - diff --git a/queue-5.15/series b/queue-5.15/series index bbf68e9b5a3..04cba6e08cb 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -297,7 +297,6 @@ vrf-run-conntrack-only-in-context-of-lower-physdev-f.patch net-annotate-data-race-in-neigh_output.patch acpi-ac-quirk-gk45-to-skip-reading-_psr.patch acpi-resources-add-one-more-medion-model-in-irq-over.patch -net-dsa-flush-switchdev-workqueue-when-leaving-the-b.patch btrfs-reflink-initialize-return-value-to-0-in-btrfs_.patch btrfs-do-not-take-the-uuid_mutex-in-btrfs_rm_device.patch spi-bcm-qspi-fix-missing-clk_disable_unprepare-on-er.patch -- 2.47.2