Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1400736 > unrolled thread
| Started by | Vitaly Kuznetsov <vkuznets@redhat.com> |
|---|---|
| First post | 2016-05-13 14:00 +0200 |
| Last post | 2016-05-16 19:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH net-next v2 0/6] hv_netvsc: avoid races on mtu change/set channels Vitaly Kuznetsov <vkuznets@redhat.com> - 2016-05-13 14:00 +0200
Re: [PATCH net-next v2 0/6] hv_netvsc: avoid races on mtu change/set channels David Miller <davem@davemloft.net> - 2016-05-16 19:30 +0200
| From | Vitaly Kuznetsov <vkuznets@redhat.com> |
|---|---|
| Date | 2016-05-13 14:00 +0200 |
| Subject | [PATCH net-next v2 0/6] hv_netvsc: avoid races on mtu change/set channels |
| Message-ID | <ryjV7-2yY-9@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2016-05-16 19:30 +0200 |
| Subject | Re: [PATCH net-next v2 0/6] hv_netvsc: avoid races on mtu change/set channels |
| Message-ID | <rzuve-1tB-37@gated-at.bofh.it> |
| In reply to | #1400736 |
From: Vitaly Kuznetsov <vkuznets@redhat.com> Date: Fri, 13 May 2016 13:55:19 +0200 > 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. Series applied, thanks.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web