mlx4_en: Fix BQL reset TX queue call point
authorTom Herbert <therbert@google.com>
Wed, 6 Feb 2013 07:58:41 +0000 (07:58 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Feb 2013 04:33:51 +0000 (23:33 -0500)
Fix issue in Mellanox driver related to BQL.  netdev_tx_reset_queue
was not being called in certain situations where the device was
being start and stopped.  Moved netdev_tx_reset_queue from the reset
device path to mlx4_en_free_tx_buf which is where the rings are
cleaned in a reset (specifically from device being stopped).

Signed-off-by: Tom Herbert <therbert@google.com>
Acked-By: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
drivers/net/ethernet/mellanox/mlx4/en_tx.c

index 4671fa556c5d5aace8096e72fe8af340163b670b..c9a191b4c313284d7a44d95eb46b428b0ee45b17 100644 (file)
@@ -1685,15 +1685,12 @@ static void mlx4_en_restart(struct work_struct *work)
                                                 watchdog_task);
        struct mlx4_en_dev *mdev = priv->mdev;
        struct net_device *dev = priv->dev;
-       int i;
 
        en_dbg(DRV, priv, "Watchdog task called for port %d\n", priv->port);
 
        mutex_lock(&mdev->state_lock);
        if (priv->port_up) {
                mlx4_en_stop_port(dev, 1);
-               for (i = 0; i < priv->tx_ring_num; i++)
-                       netdev_tx_reset_queue(priv->tx_ring[i].tx_queue);
                if (mlx4_en_start_port(dev))
                        en_err(priv, "Failed restarting port %d\n", priv->port);
        }
index 3b28e167b05b608034845faa61c81891bee5a2c7..49308cc65ee7f48a786fa25c993a72c4cecc7361 100644 (file)
@@ -294,6 +294,8 @@ int mlx4_en_free_tx_buf(struct net_device *dev, struct mlx4_en_tx_ring *ring)
                cnt++;
        }
 
+       netdev_tx_reset_queue(ring->tx_queue);
+
        if (cnt)
                en_dbg(DRV, priv, "Freed %d uncompleted tx descriptors\n", cnt);