Thread (2 messages) 2 messages, 2 authors, 2024-02-01

Re: [PATCH v2 net] net: bridge: switchdev: Skip MDB replays of pending events

From: Antoine Tenart <atenart@kernel.org>
Date: 2024-02-01 14:46:31
Also in: bridge

Hello,

Quoting Tobias Waldekranz (2024-02-01 15:00:24)
quoted hunk ↗ jump to hunk
 
@@ -677,22 +691,26 @@ br_switchdev_mdb_replay(struct net_device *br_dev, struct net_device *dev,
-       rcu_read_lock();
+       spin_lock_bh(&br->multicast_lock);
The two errors path below also need to be converted from rcu_read_unlock
to spin_unlock_bh.

You also probably need to s/rcu_dereference/mlock_dereference/ below
(not shown in the diff) now that this snippet is outside an rcu read
section.
quoted hunk ↗ jump to hunk
 
-       hlist_for_each_entry_rcu(mp, &br->mdb_list, mdb_node) {
+       hlist_for_each_entry(mp, &br->mdb_list, mdb_node) {
                struct net_bridge_port_group __rcu * const *pp;
                const struct net_bridge_port_group *p;
 
                if (mp->host_joined) {
-                       err = br_switchdev_mdb_queue_one(&mdb_list,
+                       err = br_switchdev_mdb_queue_one(&mdb_list, dev, action,
                                                         SWITCHDEV_OBJ_ID_HOST_MDB,
                                                         mp, br_dev);
                        if (err) {
@@ -706,7 +724,7 @@ br_switchdev_mdb_replay(struct net_device *br_dev, struct net_device *dev,
                        if (p->key.port->dev != dev)
                                continue;
 
-                       err = br_switchdev_mdb_queue_one(&mdb_list,
+                       err = br_switchdev_mdb_queue_one(&mdb_list, dev, action,
                                                         SWITCHDEV_OBJ_ID_PORT_MDB,
                                                         mp, dev);
                        if (err) {
@@ -716,12 +734,7 @@ br_switchdev_mdb_replay(struct net_device *br_dev, struct net_device *dev,
                }
        }
 
-       rcu_read_unlock();
-
-       if (adding)
-               action = SWITCHDEV_PORT_OBJ_ADD;
-       else
-               action = SWITCHDEV_PORT_OBJ_DEL;
+       spin_unlock_bh(&br->multicast_lock);
Thanks,
Antoine
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help