* [PATCH for-net] net/mlx4_en: Check device state when setting coalescing
@ 2013-09-12 15:11 Amir Vadai
2013-09-13 3:42 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Amir Vadai @ 2013-09-12 15:11 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Amir Vadai, Or Gerlitz, Gideon Naim, Eugenia Emantayev
From: Eugenia Emantayev <eugenia@mellanox.com>
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>
---
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 16 ++++++++++------
1 file 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 a28cd80..0c75098 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)
for (i = 0; i < priv->tx_ring_num; i++) {
priv->tx_cq[i].moder_cnt = priv->tx_frames;
priv->tx_cq[i].moder_time = priv->tx_usecs;
- err = mlx4_en_set_cq_moder(priv, &priv->tx_cq[i]);
- if (err)
- return err;
+ if (priv->port_up) {
+ err = mlx4_en_set_cq_moder(priv, &priv->tx_cq[i]);
+ if (err)
+ return err;
+ }
}
if (priv->adaptive_rx_coal)
@@ -65,9 +67,11 @@ static int mlx4_en_moderation_update(struct mlx4_en_priv *priv)
priv->rx_cq[i].moder_cnt = priv->rx_frames;
priv->rx_cq[i].moder_time = priv->rx_usecs;
priv->last_moder_time[i] = MLX4_EN_AUTO_CONF;
- err = mlx4_en_set_cq_moder(priv, &priv->rx_cq[i]);
- if (err)
- return err;
+ if (priv->port_up) {
+ err = mlx4_en_set_cq_moder(priv, &priv->rx_cq[i]);
+ if (err)
+ return err;
+ }
}
return err;
--
1.8.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH for-net] net/mlx4_en: Check device state when setting coalescing
2013-09-12 15:11 [PATCH for-net] net/mlx4_en: Check device state when setting coalescing Amir Vadai
@ 2013-09-13 3:42 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-09-13 3:42 UTC (permalink / raw)
To: amirv; +Cc: netdev, ogerlitz, gideonn, eugenia
From: Amir Vadai <amirv@mellanox.com>
Date: Thu, 12 Sep 2013 18:11:20 +0300
> From: Eugenia Emantayev <eugenia@mellanox.com>
>
> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-09-13 3:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-12 15:11 [PATCH for-net] net/mlx4_en: Check device state when setting coalescing Amir Vadai
2013-09-13 3:42 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).