From: Erez Shitrit Date: Thu, 27 Oct 2016 13:27:17 +0000 (+0300) Subject: net/mlx4_en: Process all completions in RX rings after port goes up X-Git-Tag: v3.2.85~60 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=df14acfd79e4c7ef7d12e043d7d9b164dc2897bc net/mlx4_en: Process all completions in RX rings after port goes up commit 8d59de8f7bb3db296331c665779c653b0c8d13ba upstream. Currently there is a race between incoming traffic and initialization flow. HW is able to receive the packets after INIT_PORT is done and unicast steering is configured. Before we set priv->port_up NAPI is not scheduled and receive queues become full. Therefore we never get new interrupts about the completions. This issue could happen if running heavy traffic during bringing port up. The resolution is to schedule NAPI once port_up is set. If receive queues were full this will process all cqes and release them. Fixes: c27a02cd94d6 ("mlx4_en: Add driver for Mellanox ConnectX 10GbE NIC") Signed-off-by: Erez Shitrit Signed-off-by: Eugenia Emantayev Signed-off-by: Tariq Toukan Signed-off-by: David S. Miller [bwh: Backported to 3.2: mlx4_en_priv::rx_cq is an array of structs not pointers] Signed-off-by: Ben Hutchings --- diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index 308349a43d60..3926b766148e 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c @@ -684,6 +684,13 @@ int mlx4_en_start_port(struct net_device *dev) queue_work(mdev->workqueue, &priv->mcast_task); priv->port_up = true; + + /* Process all completions if exist to prevent + * the queues freezing if they are full + */ + for (i = 0; i < priv->rx_ring_num; i++) + napi_schedule(&priv->rx_cq[i].napi); + netif_tx_start_all_queues(dev); return 0;