summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugenia Emantayev <eugenia@mellanox.com>2013-01-24 05:54:14 +0400
committerDavid S. Miller <davem@davemloft.net>2013-01-28 09:13:56 +0400
commit2d51837fa1ee7ff5c42f34b07dc460daff6afda1 (patch)
tree6b70bd8aaf3d6098ce7eca54407a886f586c4775
parenta1b1add07fa794974573d93483d68e373edfe7bd (diff)
downloadlinux-2d51837fa1ee7ff5c42f34b07dc460daff6afda1.tar.xz
net/mlx4_en: Issue the dump eth statistics command under lock
Performing the DUMP_ETH_STATS firmware command outside the lock leads to kernel panic when data structures such as RX/TX rings are freed in parallel, e.g when one changes the mtu or ring sizes. Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com> Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_netdev.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index b4675138533a..b6c645fc6c48 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -977,12 +977,12 @@ static void mlx4_en_do_get_stats(struct work_struct *work)
struct mlx4_en_dev *mdev = priv->mdev;
int err;
- err = mlx4_en_DUMP_ETH_STATS(mdev, priv->port, 0);
- if (err)
- en_dbg(HW, priv, "Could not update stats\n");
-
mutex_lock(&mdev->state_lock);
if (mdev->device_up) {
+ err = mlx4_en_DUMP_ETH_STATS(mdev, priv->port, 0);
+ if (err)
+ en_dbg(HW, priv, "Could not update stats\n");
+
if (priv->port_up)
mlx4_en_auto_moderation(priv);