mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, devel@linuxdriverproject.org,
	Haiyang Zhang <haiyangz@microsoft.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	"Lino Sanfilippo" <LinoSanfilippo@gmx.de>
Subject: [PATCH net-next v2 0/6] hv_netvsc: avoid races on mtu change/set channels
Date: Fri, 13 May 2016 13:55:19 +0200	[thread overview]
Message-ID: <1463140525-27338-1-git-send-email-vkuznets@redhat.com> (raw)

Changes since v1:
- Rebased to net-next [Haiyang Zhang]

Original description:

MTU change and set channels operations are implemented as netvsc device
re-creation destroying internal structures (struct net_device stays). This
is really unfortunate but there is no support from Hyper-V host to do it
in a different way. Such re-creation is unsurprisingly racy, Haiyang
reported a crash when netvsc_change_mtu() is racing with
netvsc_link_change() but I was able to identify additional races upon
investigation. Both netvsc_set_channels() and netvsc_change_mtu() race
against:
1) netvsc_link_change()
2) netvsc_remove()
3) netvsc_send()

To solve these issues without introducing new locks some refactoring is
required. We need to get rid of very complex link graph in all the
internal structures and avoid traveling through structures which are being
removed.

Vitaly Kuznetsov (6):
  hv_netvsc: move start_remove flag to net_device_context
  hv_netvsc: use start_remove flag to protect netvsc_link_change()
  hv_netvsc: untangle the pointer mess
  hv_netvsc: get rid of struct net_device pointer in struct
    netvsc_device
  hv_netvsc: synchronize netvsc_change_mtu()/netvsc_set_channels() with
    netvsc_remove()
  hv_netvsc: set nvdev link after populating chn_table

 drivers/net/hyperv/hyperv_net.h   |  17 ++--
 drivers/net/hyperv/netvsc.c       | 136 +++++++++++++----------------
 drivers/net/hyperv/netvsc_drv.c   | 178 ++++++++++++++++++++++----------------
 drivers/net/hyperv/rndis_filter.c |  82 +++++++++---------
 4 files changed, 215 insertions(+), 198 deletions(-)

-- 
2.5.5

             reply	other threads:[~2016-05-13 11:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13 11:55 Vitaly Kuznetsov [this message]
2016-05-13 11:55 ` [PATCH net-next v2 1/6] hv_netvsc: move start_remove flag to net_device_context Vitaly Kuznetsov
2016-05-13 11:55 ` [PATCH net-next v2 2/6] hv_netvsc: use start_remove flag to protect netvsc_link_change() Vitaly Kuznetsov
2016-05-13 11:55 ` [PATCH net-next v2 3/6] hv_netvsc: untangle the pointer mess Vitaly Kuznetsov
2016-05-13 11:55 ` [PATCH net-next v2 4/6] hv_netvsc: get rid of struct net_device pointer in struct netvsc_device Vitaly Kuznetsov
2016-05-13 11:55 ` [PATCH net-next v2 5/6] hv_netvsc: synchronize netvsc_change_mtu()/netvsc_set_channels() with netvsc_remove() Vitaly Kuznetsov
2016-05-13 11:55 ` [PATCH net-next v2 6/6] hv_netvsc: set nvdev link after populating chn_table Vitaly Kuznetsov
2016-05-16 17:27 ` [PATCH net-next v2 0/6] hv_netvsc: avoid races on mtu change/set channels 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=1463140525-27338-1-git-send-email-vkuznets@redhat.com \
    --to=vkuznets@redhat.com \
    --cc=LinoSanfilippo@gmx.de \
    --cc=devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®