[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190731155338.15ff34cb@hermes.lan>
Date: Wed, 31 Jul 2019 15:53:38 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
Cc: netdev@...r.kernel.org, roopa@...ulusnetworks.com,
davem@...emloft.net, bridge@...ts.linux-foundation.org,
michael-dev <michael-dev@...i-braun.de>
Subject: Re: [PATCH net v3] net: bridge: move vlan init/deinit to
NETDEV_REGISTER/UNREGISTER
> -int br_vlan_init(struct net_bridge *br)
> +static int br_vlan_init(struct net_bridge *br)
> {
> struct net_bridge_vlan_group *vg;
> int ret = -ENOMEM;
> @@ -1083,6 +1085,8 @@ int br_vlan_init(struct net_bridge *br)
> return ret;
>
> err_vlan_add:
> + RCU_INIT_POINTER(br->vlgrp, NULL);
> + synchronize_rcu();
Calling sychronize_rcu is expensive. And the callback for
notifier is always called with rtnl_head.
Why not just keep the pointer initialization back in the
code where bridge is created, it was safe there.
Powered by blists - more mailing lists