linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	netdev@vger.kernel.org, Haiyang Zhang <haiyangz@microsoft.com>,
	linux-kernel@vger.kernel.org, devel@linuxdriverproject.org
Subject: Re: [PATCH net-next 3/4] hv_netvsc: reset net_device_ctx->nvdev with rcu_assign_pointer()
Date: Tue, 31 Oct 2017 17:45:33 +0100	[thread overview]
Message-ID: <20171031174533.6877e1a5@shemminger-XPS-13-9360> (raw)
In-Reply-To: <1509458998.3828.19.camel@edumazet-glaptop3.roam.corp.google.com>

On Tue, 31 Oct 2017 07:09:58 -0700
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> On Tue, 2017-10-31 at 14:42 +0100, Vitaly Kuznetsov wrote:
> > RCU_INIT_POINTER() is not suitable here as it doesn't give us ordering
> > guarantees (see the comment in rcupdate.h). This is also not a hotpath.
> > 
> > Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> > ---
> >  drivers/net/hyperv/netvsc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
> > index bfc79698b8f4..12efb3e34775 100644
> > --- a/drivers/net/hyperv/netvsc.c
> > +++ b/drivers/net/hyperv/netvsc.c
> > @@ -560,7 +560,7 @@ void netvsc_device_remove(struct hv_device *device)
> >  
> >  	netvsc_revoke_buf(device, net_device);
> >  
> > -	RCU_INIT_POINTER(net_device_ctx->nvdev, NULL);
> > +	rcu_assign_pointer(net_device_ctx->nvdev, NULL);  
> 
> I see no point for this patch.
> 
> Setting a NULL pointer needs no barrier at all.

Agreed with Eric.

  parent reply	other threads:[~2017-10-31 16:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31 13:42 [PATCH net-next 0/4] hv_netvsc: fix some crashes and hangs on channel/mtu changes Vitaly Kuznetsov
2017-10-31 13:42 ` [PATCH net-next 1/4] hv_netvsc: netvsc_teardown_gpadl() split Vitaly Kuznetsov
2017-10-31 16:37   ` Stephen Hemminger
2017-10-31 13:42 ` [PATCH net-next 2/4] hv_netvsc: protect nvdev->extension with RCU Vitaly Kuznetsov
2017-10-31 16:44   ` Stephen Hemminger
2017-10-31 17:13     ` Vitaly Kuznetsov
2017-11-02 10:27       ` Vitaly Kuznetsov
2017-10-31 13:42 ` [PATCH net-next 3/4] hv_netvsc: reset net_device_ctx->nvdev with rcu_assign_pointer() Vitaly Kuznetsov
2017-10-31 14:09   ` Eric Dumazet
2017-10-31 14:40     ` Vitaly Kuznetsov
2017-10-31 14:44       ` David Miller
2017-10-31 14:50         ` Vitaly Kuznetsov
2017-10-31 16:45     ` Stephen Hemminger [this message]
2017-10-31 13:42 ` [PATCH net-next 4/4] hv_netvsc: hide warnings about uninitialized/missing rndis device Vitaly Kuznetsov

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=20171031174533.6877e1a5@shemminger-XPS-13-9360 \
    --to=stephen@networkplumber.org \
    --cc=devel@linuxdriverproject.org \
    --cc=eric.dumazet@gmail.com \
    --cc=haiyangz@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=vkuznets@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).