All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Cc: netdev@vger.kernel.org, roopa@cumulusnetworks.com,
	bridge@lists.linux-foundation.org, davem@davemloft.net,
	michael-dev <michael-dev@fami-braun.de>
Subject: Re: [Bridge] [PATCH net v3] net: bridge: move vlan init/deinit to NETDEV_REGISTER/UNREGISTER
Date: Wed, 31 Jul 2019 15:53:38 -0700	[thread overview]
Message-ID: <20190731155338.15ff34cb@hermes.lan> (raw)
In-Reply-To: <20190731224955.10908-1-nikolay@cumulusnetworks.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: Stephen Hemminger <stephen@networkplumber.org>
To: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Cc: netdev@vger.kernel.org, roopa@cumulusnetworks.com,
	davem@davemloft.net, bridge@lists.linux-foundation.org,
	michael-dev <michael-dev@fami-braun.de>
Subject: Re: [PATCH net v3] net: bridge: move vlan init/deinit to NETDEV_REGISTER/UNREGISTER
Date: Wed, 31 Jul 2019 15:53:38 -0700	[thread overview]
Message-ID: <20190731155338.15ff34cb@hermes.lan> (raw)
In-Reply-To: <20190731224955.10908-1-nikolay@cumulusnetworks.com>

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

  reply	other threads:[~2019-07-31 22:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-31 18:36 [Bridge] [PATCH net] net: bridge: move vlan init/deinit to NETDEV_REGISTER/UNREGISTER Nikolay Aleksandrov
2019-07-31 18:36 ` Nikolay Aleksandrov
2019-07-31 22:37 ` [Bridge] [PATCH net v2] " Nikolay Aleksandrov
2019-07-31 22:37   ` Nikolay Aleksandrov
2019-07-31 22:40   ` [Bridge] " Nikolay Aleksandrov
2019-07-31 22:40     ` Nikolay Aleksandrov
2019-07-31 22:49     ` [Bridge] [PATCH net v3] " Nikolay Aleksandrov
2019-07-31 22:49       ` Nikolay Aleksandrov
2019-07-31 22:53       ` Stephen Hemminger [this message]
2019-07-31 22:53         ` Stephen Hemminger
2019-07-31 23:32         ` [Bridge] " Nikolay Aleksandrov
2019-07-31 23:32           ` Nikolay Aleksandrov
2019-07-31 23:36           ` [Bridge] " Nikolay Aleksandrov
2019-07-31 23:36             ` Nikolay Aleksandrov
2019-08-02  0:38       ` [Bridge] " Nikolay Aleksandrov
2019-08-02  0:38         ` Nikolay Aleksandrov
2019-08-02 10:57         ` [Bridge] [PATCH net v4] net: bridge: move default pvid " Nikolay Aleksandrov
2019-08-02 10:57           ` Nikolay Aleksandrov
2019-08-02 14:29           ` [Bridge] " Roopa Prabhu
2019-08-02 14:29             ` Roopa Prabhu
2019-08-02 15:35           ` [Bridge] " Stephen Hemminger
2019-08-02 15:35             ` Stephen Hemminger
2019-08-02 15:41             ` [Bridge] " Nikolay Aleksandrov
2019-08-02 15:41               ` Nikolay Aleksandrov
2019-08-05 20:33           ` [Bridge] " David Miller
2019-08-05 20:33             ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190731155338.15ff34cb@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=michael-dev@fami-braun.de \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=roopa@cumulusnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.