diff options
author | Yevgeny Petrilin <yevgenyp@mellanox.co.il> | 2010-08-23 23:46:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-24 17:54:52 -0400 |
commit | bc081cecf3cb3da236061cf353d74c42ba7e37fb (patch) | |
tree | b0a70206f8868c37e8ecc110afd9d33a8c1168ed /drivers/net/mlx4/en_ethtool.c | |
parent | 7699517db435fd24143bd32dd644275e3eeb4c86 (diff) |
mlx4_en: get/set ringsize uses actual ring size
In case that the rings were not fully filled, the report in Ethtool
should be according to the actual size that was filled.
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mlx4/en_ethtool.c')
-rw-r--r-- | drivers/net/mlx4/en_ethtool.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/mlx4/en_ethtool.c b/drivers/net/mlx4/en_ethtool.c index fa2f2f43ab48..c5551f2cf260 100644 --- a/drivers/net/mlx4/en_ethtool.c +++ b/drivers/net/mlx4/en_ethtool.c | |||
@@ -394,8 +394,9 @@ static int mlx4_en_set_ringparam(struct net_device *dev, | |||
394 | tx_size = max_t(u32, tx_size, MLX4_EN_MIN_TX_SIZE); | 394 | tx_size = max_t(u32, tx_size, MLX4_EN_MIN_TX_SIZE); |
395 | tx_size = min_t(u32, tx_size, MLX4_EN_MAX_TX_SIZE); | 395 | tx_size = min_t(u32, tx_size, MLX4_EN_MAX_TX_SIZE); |
396 | 396 | ||
397 | if (rx_size == priv->prof->rx_ring_size && | 397 | if (rx_size == (priv->port_up ? priv->rx_ring[0].actual_size : |
398 | tx_size == priv->prof->tx_ring_size) | 398 | priv->rx_ring[0].size) && |
399 | tx_size == priv->tx_ring[0].size) | ||
399 | return 0; | 400 | return 0; |
400 | 401 | ||
401 | mutex_lock(&mdev->state_lock); | 402 | mutex_lock(&mdev->state_lock); |
@@ -429,13 +430,13 @@ static void mlx4_en_get_ringparam(struct net_device *dev, | |||
429 | struct ethtool_ringparam *param) | 430 | struct ethtool_ringparam *param) |
430 | { | 431 | { |
431 | struct mlx4_en_priv *priv = netdev_priv(dev); | 432 | struct mlx4_en_priv *priv = netdev_priv(dev); |
432 | struct mlx4_en_dev *mdev = priv->mdev; | ||
433 | 433 | ||
434 | memset(param, 0, sizeof(*param)); | 434 | memset(param, 0, sizeof(*param)); |
435 | param->rx_max_pending = MLX4_EN_MAX_RX_SIZE; | 435 | param->rx_max_pending = MLX4_EN_MAX_RX_SIZE; |
436 | param->tx_max_pending = MLX4_EN_MAX_TX_SIZE; | 436 | param->tx_max_pending = MLX4_EN_MAX_TX_SIZE; |
437 | param->rx_pending = mdev->profile.prof[priv->port].rx_ring_size; | 437 | param->rx_pending = priv->port_up ? |
438 | param->tx_pending = mdev->profile.prof[priv->port].tx_ring_size; | 438 | priv->rx_ring[0].actual_size : priv->rx_ring[0].size; |
439 | param->tx_pending = priv->tx_ring[0].size; | ||
439 | } | 440 | } |
440 | 441 | ||
441 | static int mlx4_ethtool_op_set_flags(struct net_device *dev, u32 data) | 442 | static int mlx4_ethtool_op_set_flags(struct net_device *dev, u32 data) |