diff options
author | Yevgeny Petrilin <yevgenyp@mellanox.co.il> | 2009-01-08 13:57:37 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-08 13:57:37 -0500 |
commit | bd531e36b8aa223aded15493d0a93930e1de51c6 (patch) | |
tree | 21c7eccf4587d0bdcb228b61ea2e346ac3946263 /drivers/net/mlx4 | |
parent | 41efea5a34caa76c11e56458db21eb259d5c6384 (diff) |
mlx4_en: Returning real Max in get_ringparam
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mlx4')
-rw-r--r-- | drivers/net/mlx4/en_params.c | 6 | ||||
-rw-r--r-- | drivers/net/mlx4/mlx4_en.h | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/mlx4/en_params.c b/drivers/net/mlx4/en_params.c index cfeef0f1bacc..c1bd040b9e05 100644 --- a/drivers/net/mlx4/en_params.c +++ b/drivers/net/mlx4/en_params.c | |||
@@ -399,8 +399,10 @@ static int mlx4_en_set_ringparam(struct net_device *dev, | |||
399 | 399 | ||
400 | rx_size = roundup_pow_of_two(param->rx_pending); | 400 | rx_size = roundup_pow_of_two(param->rx_pending); |
401 | rx_size = max_t(u32, rx_size, MLX4_EN_MIN_RX_SIZE); | 401 | rx_size = max_t(u32, rx_size, MLX4_EN_MIN_RX_SIZE); |
402 | rx_size = min_t(u32, rx_size, MLX4_EN_MAX_RX_SIZE); | ||
402 | tx_size = roundup_pow_of_two(param->tx_pending); | 403 | tx_size = roundup_pow_of_two(param->tx_pending); |
403 | tx_size = max_t(u32, tx_size, MLX4_EN_MIN_TX_SIZE); | 404 | tx_size = max_t(u32, tx_size, MLX4_EN_MIN_TX_SIZE); |
405 | tx_size = min_t(u32, tx_size, MLX4_EN_MAX_TX_SIZE); | ||
404 | 406 | ||
405 | if (rx_size == priv->prof->rx_ring_size && | 407 | if (rx_size == priv->prof->rx_ring_size && |
406 | tx_size == priv->prof->tx_ring_size) | 408 | tx_size == priv->prof->tx_ring_size) |
@@ -440,8 +442,8 @@ static void mlx4_en_get_ringparam(struct net_device *dev, | |||
440 | struct mlx4_en_dev *mdev = priv->mdev; | 442 | struct mlx4_en_dev *mdev = priv->mdev; |
441 | 443 | ||
442 | memset(param, 0, sizeof(*param)); | 444 | memset(param, 0, sizeof(*param)); |
443 | param->rx_max_pending = mdev->dev->caps.max_rq_sg; | 445 | param->rx_max_pending = MLX4_EN_MAX_RX_SIZE; |
444 | param->tx_max_pending = mdev->dev->caps.max_sq_sg; | 446 | param->tx_max_pending = MLX4_EN_MAX_TX_SIZE; |
445 | param->rx_pending = mdev->profile.prof[priv->port].rx_ring_size; | 447 | param->rx_pending = mdev->profile.prof[priv->port].rx_ring_size; |
446 | param->tx_pending = mdev->profile.prof[priv->port].tx_ring_size; | 448 | param->tx_pending = mdev->profile.prof[priv->port].tx_ring_size; |
447 | } | 449 | } |
diff --git a/drivers/net/mlx4/mlx4_en.h b/drivers/net/mlx4/mlx4_en.h index 08bf321a9e62..e9af32d41ca4 100644 --- a/drivers/net/mlx4/mlx4_en.h +++ b/drivers/net/mlx4/mlx4_en.h | |||
@@ -115,6 +115,10 @@ enum { | |||
115 | }; | 115 | }; |
116 | #define MLX4_EN_MAX_RX_FRAGS 4 | 116 | #define MLX4_EN_MAX_RX_FRAGS 4 |
117 | 117 | ||
118 | /* Maximum ring sizes */ | ||
119 | #define MLX4_EN_MAX_TX_SIZE 8192 | ||
120 | #define MLX4_EN_MAX_RX_SIZE 8192 | ||
121 | |||
118 | /* Minimum ring size for our page-allocation sceme to work */ | 122 | /* Minimum ring size for our page-allocation sceme to work */ |
119 | #define MLX4_EN_MIN_RX_SIZE (MLX4_EN_ALLOC_SIZE / SMP_CACHE_BYTES) | 123 | #define MLX4_EN_MIN_RX_SIZE (MLX4_EN_ALLOC_SIZE / SMP_CACHE_BYTES) |
120 | #define MLX4_EN_MIN_TX_SIZE (4096 / TXBB_SIZE) | 124 | #define MLX4_EN_MIN_TX_SIZE (4096 / TXBB_SIZE) |