* [PATCH net-next 0/2] netvsc: fix module removal hangs
@ 2017-03-09 23:04 Stephen Hemminger
2017-03-09 23:04 ` [PATCH net-next 1/2] netvsc: need napi scheduled during removal Stephen Hemminger
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Stephen Hemminger @ 2017-03-09 23:04 UTC (permalink / raw)
To: kys, haiyangz, davem; +Cc: netdev, Stephen Hemminger
A couple of patches are necessary to make netvsc driver module
removable again.
Stephen Hemminger (2):
netvsc: need napi scheduled during removal
netvsc: fix hang on netvsc module removal
drivers/net/hyperv/netvsc.c | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
--
2.11.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next 1/2] netvsc: need napi scheduled during removal
2017-03-09 23:04 [PATCH net-next 0/2] netvsc: fix module removal hangs Stephen Hemminger
@ 2017-03-09 23:04 ` Stephen Hemminger
2017-03-09 23:04 ` [PATCH net-next 2/2] netvsc: fix hang on netvsc module removal Stephen Hemminger
2017-03-13 6:15 ` [PATCH net-next 0/2] netvsc: fix module removal hangs David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2017-03-09 23:04 UTC (permalink / raw)
To: kys, haiyangz, davem; +Cc: netdev, Stephen Hemminger
Since rndis_halt_device waits until all outstanding sends and
receives are completed. Netvsc device needs to still schedule
NAPI to see those completions.
Fixes: 2506b1dc4bbe ("netvsc: implement NAPI")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
drivers/net/hyperv/netvsc.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index b1328cef9d5a..0e0c757c1681 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -91,15 +91,6 @@ static void free_netvsc_device(struct netvsc_device *nvdev)
}
-static inline bool netvsc_channel_idle(const struct netvsc_device *net_device,
- u16 q_idx)
-{
- const struct netvsc_channel *nvchan = &net_device->chan_table[q_idx];
-
- return atomic_read(&net_device->num_outstanding_recvs) == 0 &&
- atomic_read(&nvchan->queue_sends) == 0;
-}
-
static struct netvsc_device *get_outbound_net_device(struct hv_device *device)
{
struct netvsc_device *net_device = hv_device_to_netvsc_device(device);
@@ -1273,13 +1264,10 @@ void netvsc_channel_cb(void *context)
if (unlikely(!ndev))
return;
- net_device = net_device_to_netvsc_device(ndev);
- if (unlikely(net_device->destroy) &&
- netvsc_channel_idle(net_device, q_idx))
- return;
-
/* disable interupts from host */
hv_begin_read(&channel->inbound);
+
+ net_device = net_device_to_netvsc_device(ndev);
napi_schedule(&net_device->chan_table[q_idx].napi);
}
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next 2/2] netvsc: fix hang on netvsc module removal
2017-03-09 23:04 [PATCH net-next 0/2] netvsc: fix module removal hangs Stephen Hemminger
2017-03-09 23:04 ` [PATCH net-next 1/2] netvsc: need napi scheduled during removal Stephen Hemminger
@ 2017-03-09 23:04 ` Stephen Hemminger
2017-03-13 6:15 ` [PATCH net-next 0/2] netvsc: fix module removal hangs David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2017-03-09 23:04 UTC (permalink / raw)
To: kys, haiyangz, davem; +Cc: netdev, Stephen Hemminger
The code in netvsc_device_remove was incorrectly calling napi_disable
repeatedly on the same element. This would cause attempts
to remove netvsc module to hang.
Fixes: 2506b1dc4bbe ("netvsc: implement NAPI")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
drivers/net/hyperv/netvsc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 0e0c757c1681..8f9aeec2ce0f 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -562,8 +562,8 @@ void netvsc_device_remove(struct hv_device *device)
/* Now, we can close the channel safely */
vmbus_close(device->channel);
- for (i = 0; i < VRSS_CHANNEL_MAX; i++)
- napi_disable(&net_device->chan_table[0].napi);
+ for (i = 0; i < net_device->num_chn; i++)
+ napi_disable(&net_device->chan_table[i].napi);
/* Release all resources */
free_netvsc_device(net_device);
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 0/2] netvsc: fix module removal hangs
2017-03-09 23:04 [PATCH net-next 0/2] netvsc: fix module removal hangs Stephen Hemminger
2017-03-09 23:04 ` [PATCH net-next 1/2] netvsc: need napi scheduled during removal Stephen Hemminger
2017-03-09 23:04 ` [PATCH net-next 2/2] netvsc: fix hang on netvsc module removal Stephen Hemminger
@ 2017-03-13 6:15 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-03-13 6:15 UTC (permalink / raw)
To: stephen; +Cc: kys, haiyangz, netdev, sthemmin
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Thu, 9 Mar 2017 15:04:13 -0800
> A couple of patches are necessary to make netvsc driver module
> removable again.
Series applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-03-13 6:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-09 23:04 [PATCH net-next 0/2] netvsc: fix module removal hangs Stephen Hemminger
2017-03-09 23:04 ` [PATCH net-next 1/2] netvsc: need napi scheduled during removal Stephen Hemminger
2017-03-09 23:04 ` [PATCH net-next 2/2] netvsc: fix hang on netvsc module removal Stephen Hemminger
2017-03-13 6:15 ` [PATCH net-next 0/2] netvsc: fix module removal hangs David Miller
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).