Commit 6123db2e authored by Jack Morgenstein's avatar Jack Morgenstein Committed by David S. Miller

net/mlx4_en: Do not query stats when device port is down

There are no counters allocated to the eth device when the port is down, so
this query is meaningless at that time.

It also leads to querying incorrect counters (since the counter_index is not
valid when the device port is down).
Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.com>
Signed-off-by: default avatarAmir Vadai <amirv@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8850494a
...@@ -1375,12 +1375,13 @@ static void mlx4_en_do_get_stats(struct work_struct *work) ...@@ -1375,12 +1375,13 @@ static void mlx4_en_do_get_stats(struct work_struct *work)
mutex_lock(&mdev->state_lock); mutex_lock(&mdev->state_lock);
if (mdev->device_up) { if (mdev->device_up) {
if (priv->port_up) {
err = mlx4_en_DUMP_ETH_STATS(mdev, priv->port, 0); err = mlx4_en_DUMP_ETH_STATS(mdev, priv->port, 0);
if (err) if (err)
en_dbg(HW, priv, "Could not update stats\n"); en_dbg(HW, priv, "Could not update stats\n");
if (priv->port_up)
mlx4_en_auto_moderation(priv); mlx4_en_auto_moderation(priv);
}
queue_delayed_work(mdev->workqueue, &priv->stats_task, STATS_DELAY); queue_delayed_work(mdev->workqueue, &priv->stats_task, STATS_DELAY);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment