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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Quoting Tobias Waldekranz (2024-02-01 15:00:24)
>  
> @@ -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.

>  
> -       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





[Index of Archives]     [Netdev]     [AoE Tools]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux