Skip to contentSkip to conversation

hv_netvsc: remove ndo_poll_controller

PATCH Applied Stephen Hemminger 3 participants 4 messages Sep 29, 2018 – Oct 3, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

Cc Haiyang Zhang <[email protected]>
Cc Eric Dumazet <[email protected]>
---
 drivers/net/hyperv/netvsc_drv.c | 23 -----------------------
 1 file changed, 23 deletions(-)
drivers/net/hyperv/netvsc_drv.c +0 -23
index ec699741170b..d7f843463bf2 100644
@@ -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
 };
 
 /*
Signature · 1 line
2.17.1
#1 lore raw
Quoted 9 lines · On Sat, 29 Sep 2018 14:52:56 +0200 Stephen Hemminger…

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.

Quoted 6 lines

In netvsc driver it uses NAPI for TX completions. The default poll_napi will do this for us now and avoid the capture.

Cc Haiyang Zhang <[email protected]>
Cc Eric Dumazet <[email protected]>

Forgot to label this, it is for net-next.

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Stephen Hemminger
Quoted 18 lines

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Saturday, September 29, 2018 8:53 AM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Haiyang Zhang <[email protected]>; Eric Dumazet <[email protected]>
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.

Quoted 7 lines

In netvsc driver it uses NAPI for TX completions. The default poll_napi will do this for us now and avoid the capture.

Cc Haiyang Zhang <[email protected]>
Cc Eric Dumazet <[email protected]>

---

Thank you.

maintainer Applied
#3 lore raw
In reply to Stephen Hemminger

From: Stephen Hemminger <[email protected]>
Date: Sat, 29 Sep 2018 14:52:56 +0200

Quoted 9 lines

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.

Quoted 4 lines

In netvsc driver it uses NAPI for TX completions. The default poll_napi will do this for us now and avoid the capture.

Applied to net-next.