Skip to content

Commit a24b66c

Browse files
edumazetdavem330
authored andcommitted
mlx4: remove ndo_poll_controller
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. mlx4 uses NAPI for TX completions, so we better let core networking stack call the napi->poll() to avoid the capture. Signed-off-by: Eric Dumazet <[email protected]> Cc: Tariq Toukan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1aa28fb commit a24b66c

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

drivers/net/ethernet/mellanox/mlx4/en_netdev.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,20 +1286,6 @@ static void mlx4_en_do_set_rx_mode(struct work_struct *work)
12861286
mutex_unlock(&mdev->state_lock);
12871287
}
12881288

1289-
#ifdef CONFIG_NET_POLL_CONTROLLER
1290-
static void mlx4_en_netpoll(struct net_device *dev)
1291-
{
1292-
struct mlx4_en_priv *priv = netdev_priv(dev);
1293-
struct mlx4_en_cq *cq;
1294-
int i;
1295-
1296-
for (i = 0; i < priv->tx_ring_num[TX]; i++) {
1297-
cq = priv->tx_cq[TX][i];
1298-
napi_schedule(&cq->napi);
1299-
}
1300-
}
1301-
#endif
1302-
13031289
static int mlx4_en_set_rss_steer_rules(struct mlx4_en_priv *priv)
13041290
{
13051291
u64 reg_id;
@@ -2946,9 +2932,6 @@ static const struct net_device_ops mlx4_netdev_ops = {
29462932
.ndo_tx_timeout = mlx4_en_tx_timeout,
29472933
.ndo_vlan_rx_add_vid = mlx4_en_vlan_rx_add_vid,
29482934
.ndo_vlan_rx_kill_vid = mlx4_en_vlan_rx_kill_vid,
2949-
#ifdef CONFIG_NET_POLL_CONTROLLER
2950-
.ndo_poll_controller = mlx4_en_netpoll,
2951-
#endif
29522935
.ndo_set_features = mlx4_en_set_features,
29532936
.ndo_fix_features = mlx4_en_fix_features,
29542937
.ndo_setup_tc = __mlx4_en_setup_tc,
@@ -2983,9 +2966,6 @@ static const struct net_device_ops mlx4_netdev_ops_master = {
29832966
.ndo_set_vf_link_state = mlx4_en_set_vf_link_state,
29842967
.ndo_get_vf_stats = mlx4_en_get_vf_stats,
29852968
.ndo_get_vf_config = mlx4_en_get_vf_config,
2986-
#ifdef CONFIG_NET_POLL_CONTROLLER
2987-
.ndo_poll_controller = mlx4_en_netpoll,
2988-
#endif
29892969
.ndo_set_features = mlx4_en_set_features,
29902970
.ndo_fix_features = mlx4_en_fix_features,
29912971
.ndo_setup_tc = __mlx4_en_setup_tc,

0 commit comments

Comments
 (0)