Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: dingtianhong <dingtianhong@huawei.com>
Cc: Jay Vosburgh <fubar@us.ibm.com>,
	Andy Gospodarek <andy@greyhouse.net>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Netdev <netdev@vger.kernel.org>, Li Zefan <lizefan@huawei.com>
Subject: Re: [PATCH] bonding: add synchronize_net() after netdev_rx_handler_unregister
Date: Wed, 22 May 2013 04:45:45 -0700	[thread overview]
Message-ID: <1369223145.3301.308.camel@edumazet-glaptop> (raw)
In-Reply-To: <519C8504.1080906@huawei.com>

On Wed, 2013-05-22 at 16:42 +0800, dingtianhong wrote:
> commit 00cfec3748 (net: add a synchronize_net() ...) add a synchronize_net()
> in netdev_rx_handler_unregister() to guarantee the rx_handler  is NULL when
> rx_handler_data is a non NULL in rcu_read_lock().
> 
> so the caller should not use netdev_rx_handler_unregister in atomic as it may
> schedule and sleep, the commit fcd99434f fix the bug in bond release, but the
> problem is no action to guarantee the rx_handler_data is NULL when bond release,
> so add synchronize_net() and fix it.
> 
> This patch adds more comments to netdev_rx_handler_unregister().
> 
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> ---
>  drivers/net/bonding/bond_main.c | 2 ++
>  net/core/dev.c                  | 3 +++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index d0aade0..592a603 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -2007,6 +2007,8 @@ static int __bond_release_one(struct net_device *bond_dev,
>  	 * for this slave anymore.
>  	 */
>  	netdev_rx_handler_unregister(slave_dev);
> +	synchronize_net();
> +
>  	write_lock_bh(&bond->lock);
>  

Patch is not needed.

This was discussed on netdev, please read the archives.

Its even documented in netdev_rx_handler_unregister(), could you please
read again commit [1]

What about you describe the problems you really noticed ?

[1] commit
00cfec37484761a44a3b6f4675a54caa618210ae
("net: add a synchronize_net() in netdev_rx_handler_unregister()")

  reply	other threads:[~2013-05-22 11:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22  8:42 [PATCH] bonding: add synchronize_net() after netdev_rx_handler_unregister dingtianhong
2013-05-22 11:45 ` Eric Dumazet [this message]
2013-05-23  1:41   ` dingtianhong
2013-05-23  1:52     ` Eric Dumazet
2013-05-23  7:50       ` dingtianhong
2013-05-22 18:30 ` Sergei Shtylyov
2013-05-23  1:43   ` dingtianhong
  -- strict thread matches above, loose matches on Subject: below --
2013-05-23  1:57 dingtianhong
2013-05-23  2:04 ` Eric Dumazet

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=1369223145.3301.308.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=dingtianhong@huawei.com \
    --cc=edumazet@google.com \
    --cc=fubar@us.ibm.com \
    --cc=lizefan@huawei.com \
    --cc=netdev@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox