* [PATCH] hv_netvsc: remove ndo_poll_controller
@ 2018-09-29 12:52 Stephen Hemminger
2018-09-29 12:54 ` Stephen Hemminger
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Stephen Hemminger @ 2018-09-29 12:52 UTC (permalink / raw)
To: netdev; +Cc: Stephen Hemminger, Haiyang Zhang, Eric Dumazet
Similar to other patches from ERic.
As diagnosed by Song Liu, ndo_poll_controller() can
be very dangerous on loaded hosts, since the cpu
calling ndo_poll_controller() might steal all NAPI
contexts (for all RX/TX queues of the NIC). This capture
can last for unlimited amount of time, since one
cpu is generally not able to drain all the queues under load.
In netvsc driver it uses NAPI for TX completions. The default
poll_napi will do this for us now and avoid the capture.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Eric Dumazet <edumazet@google.com>
---
drivers/net/hyperv/netvsc_drv.c | 23 -----------------------
1 file changed, 23 deletions(-)
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index ec699741170b..d7f843463bf2 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -1564,26 +1564,6 @@ netvsc_set_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *info)
return -EOPNOTSUPP;
}
-#ifdef CONFIG_NET_POLL_CONTROLLER
-static void netvsc_poll_controller(struct net_device *dev)
-{
- struct net_device_context *ndc = netdev_priv(dev);
- struct netvsc_device *ndev;
- int i;
-
- rcu_read_lock();
- ndev = rcu_dereference(ndc->nvdev);
- if (ndev) {
- for (i = 0; i < ndev->num_chn; i++) {
- struct netvsc_channel *nvchan = &ndev->chan_table[i];
-
- napi_schedule(&nvchan->napi);
- }
- }
- rcu_read_unlock();
-}
-#endif
-
static u32 netvsc_get_rxfh_key_size(struct net_device *dev)
{
return NETVSC_HASH_KEYLEN;
@@ -1811,9 +1791,6 @@ static const struct net_device_ops device_ops = {
.ndo_set_mac_address = netvsc_set_mac_addr,
.ndo_select_queue = netvsc_select_queue,
.ndo_get_stats64 = netvsc_get_stats64,
-#ifdef CONFIG_NET_POLL_CONTROLLER
- .ndo_poll_controller = netvsc_poll_controller,
-#endif
};
/*
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] hv_netvsc: remove ndo_poll_controller
2018-09-29 12:52 [PATCH] hv_netvsc: remove ndo_poll_controller Stephen Hemminger
@ 2018-09-29 12:54 ` Stephen Hemminger
2018-09-29 14:12 ` Haiyang Zhang
2018-10-03 5:57 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2018-09-29 12:54 UTC (permalink / raw)
To: netdev; +Cc: Stephen Hemminger, Haiyang Zhang, Eric Dumazet
On Sat, 29 Sep 2018 14:52:56 +0200
Stephen Hemminger <stephen@networkplumber.org> wrote:
> Similar to other patches from ERic.
>
> As diagnosed by Song Liu, ndo_poll_controller() can
> be very dangerous on loaded hosts, since the cpu
> calling ndo_poll_controller() might steal all NAPI
> contexts (for all RX/TX queues of the NIC). This capture
> can last for unlimited amount of time, since one
> cpu is generally not able to drain all the queues under load.
>
> In netvsc driver it uses NAPI for TX completions. The default
> poll_napi will do this for us now and avoid the capture.
>
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> Cc: Haiyang Zhang <haiyangz@microsoft.com>
> Cc: Eric Dumazet <edumazet@google.com>
Forgot to label this, it is for net-next.
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] hv_netvsc: remove ndo_poll_controller
2018-09-29 12:52 [PATCH] hv_netvsc: remove ndo_poll_controller Stephen Hemminger
2018-09-29 12:54 ` Stephen Hemminger
@ 2018-09-29 14:12 ` Haiyang Zhang
2018-10-03 5:57 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Haiyang Zhang @ 2018-09-29 14:12 UTC (permalink / raw)
To: Stephen Hemminger, netdev@vger.kernel.org; +Cc: Stephen Hemminger, Eric Dumazet
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Saturday, September 29, 2018 8:53 AM
> To: netdev@vger.kernel.org
> Cc: Stephen Hemminger <sthemmin@microsoft.com>; Haiyang Zhang
> <haiyangz@microsoft.com>; Eric Dumazet <edumazet@google.com>
> Subject: [PATCH] hv_netvsc: remove ndo_poll_controller
>
> Similar to other patches from ERic.
>
> As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on
> loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI
> contexts (for all RX/TX queues of the NIC). This capture can last for unlimited
> amount of time, since one cpu is generally not able to drain all the queues
> under load.
>
> In netvsc driver it uses NAPI for TX completions. The default poll_napi will do
> this for us now and avoid the capture.
>
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> Cc: Haiyang Zhang <haiyangz@microsoft.com>
> Cc: Eric Dumazet <edumazet@google.com>
> ---
Thank you.
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hv_netvsc: remove ndo_poll_controller
2018-09-29 12:52 [PATCH] hv_netvsc: remove ndo_poll_controller Stephen Hemminger
2018-09-29 12:54 ` Stephen Hemminger
2018-09-29 14:12 ` Haiyang Zhang
@ 2018-10-03 5:57 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-10-03 5:57 UTC (permalink / raw)
To: stephen; +Cc: netdev, sthemmin, haiyangz, edumazet
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Sat, 29 Sep 2018 14:52:56 +0200
> Similar to other patches from ERic.
>
> As diagnosed by Song Liu, ndo_poll_controller() can
> be very dangerous on loaded hosts, since the cpu
> calling ndo_poll_controller() might steal all NAPI
> contexts (for all RX/TX queues of the NIC). This capture
> can last for unlimited amount of time, since one
> cpu is generally not able to drain all the queues under load.
>
> In netvsc driver it uses NAPI for TX completions. The default
> poll_napi will do this for us now and avoid the capture.
>
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Applied to net-next.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-10-03 12:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-29 12:52 [PATCH] hv_netvsc: remove ndo_poll_controller Stephen Hemminger
2018-09-29 12:54 ` Stephen Hemminger
2018-09-29 14:12 ` Haiyang Zhang
2018-10-03 5:57 ` 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).