aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorEugenia Emantayev <eugenia@mellanox.com>2013-09-12 11:11:20 -0400
committerDavid S. Miller <davem@davemloft.net>2013-09-12 23:42:15 -0400
commit38463e2c290426262cd9a75fe66cbbe2925a68c2 (patch)
treea229a81f1e3eed88dc788bad9c8317200e16a426 /drivers/net/ethernet
parentbe4f154d5ef0ca147ab6bcd38857a774133f5450 (diff)
net/mlx4_en: Check device state when setting coalescing
When the device is down, CQs are freed. We must check the device state to avoid issuing firmware commands on non existing CQs. CC: Or Gerlitz <ogerlitz@mellanox.com> 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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_ethtool.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
index a28cd801a236..0c750985f47e 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
@@ -53,9 +53,11 @@ static int mlx4_en_moderation_update(struct mlx4_en_priv *priv)
53 for (i = 0; i < priv->tx_ring_num; i++) { 53 for (i = 0; i < priv->tx_ring_num; i++) {
54 priv->tx_cq[i].moder_cnt = priv->tx_frames; 54 priv->tx_cq[i].moder_cnt = priv->tx_frames;
55 priv->tx_cq[i].moder_time = priv->tx_usecs; 55 priv->tx_cq[i].moder_time = priv->tx_usecs;
56 err = mlx4_en_set_cq_moder(priv, &priv->tx_cq[i]); 56 if (priv->port_up) {
57 if (err) 57 err = mlx4_en_set_cq_moder(priv, &priv->tx_cq[i]);
58 return err; 58 if (err)
59 return err;
60 }
59 } 61 }
60 62
61 if (priv->adaptive_rx_coal) 63 if (priv->adaptive_rx_coal)
@@ -65,9 +67,11 @@ static int mlx4_en_moderation_update(struct mlx4_en_priv *priv)
65 priv->rx_cq[i].moder_cnt = priv->rx_frames; 67 priv->rx_cq[i].moder_cnt = priv->rx_frames;
66 priv->rx_cq[i].moder_time = priv->rx_usecs; 68 priv->rx_cq[i].moder_time = priv->rx_usecs;
67 priv->last_moder_time[i] = MLX4_EN_AUTO_CONF; 69 priv->last_moder_time[i] = MLX4_EN_AUTO_CONF;
68 err = mlx4_en_set_cq_moder(priv, &priv->rx_cq[i]); 70 if (priv->port_up) {
69 if (err) 71 err = mlx4_en_set_cq_moder(priv, &priv->rx_cq[i]);
70 return err; 72 if (err)
73 return err;
74 }
71 } 75 }
72 76
73 return err; 77 return err;