netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] hv_netvsc: avoid races on mtu change/set channels
@ 2016-05-12 12:49 Vitaly Kuznetsov
  2016-05-12 12:49 ` [PATCH 1/6] hv_netvsc: move start_remove flag to net_device_context Vitaly Kuznetsov
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Vitaly Kuznetsov @ 2016-05-12 12:49 UTC (permalink / raw)
  To: netdev; +Cc: devel, Haiyang Zhang, linux-kernel

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   |  15 ++---
 drivers/net/hyperv/netvsc.c       | 130 ++++++++++++++++----------------------
 drivers/net/hyperv/netvsc_drv.c   | 104 +++++++++++++++++-------------
 drivers/net/hyperv/rndis_filter.c |  82 ++++++++++++------------
 4 files changed, 164 insertions(+), 167 deletions(-)

-- 
2.5.5

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-05-12 16:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-12 12:49 [PATCH 0/6] hv_netvsc: avoid races on mtu change/set channels Vitaly Kuznetsov
2016-05-12 12:49 ` [PATCH 1/6] hv_netvsc: move start_remove flag to net_device_context Vitaly Kuznetsov
2016-05-12 12:49 ` [PATCH 2/6] hv_netvsc: use start_remove flag to protect netvsc_link_change() Vitaly Kuznetsov
2016-05-12 12:49 ` [PATCH 3/6] hv_netvsc: untangle the pointer mess Vitaly Kuznetsov
2016-05-12 12:49 ` [PATCH 4/6] hv_netvsc: get rid of struct net_device pointer in struct netvsc_device Vitaly Kuznetsov
2016-05-12 12:49 ` [PATCH 5/6] hv_netvsc: synchronize netvsc_change_mtu()/netvsc_set_channels() with netvsc_remove() Vitaly Kuznetsov
2016-05-12 12:49 ` [PATCH 6/6] hv_netvsc: set nvdev link after populating chn_table Vitaly Kuznetsov
2016-05-12 14:58 ` Aw: [PATCH 0/6] hv_netvsc: avoid races on mtu change/set channels Lino Sanfilippo
2016-05-12 15:09   ` Vitaly Kuznetsov
2016-05-12 16:19     ` Aw: " Lino Sanfilippo

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