mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 09:14:19 +08:00
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>
This commit is contained in:
parent
41efea5a34
commit
bd531e36b8
@ -399,8 +399,10 @@ static int mlx4_en_set_ringparam(struct net_device *dev,
|
||||
|
||||
rx_size = roundup_pow_of_two(param->rx_pending);
|
||||
rx_size = max_t(u32, rx_size, MLX4_EN_MIN_RX_SIZE);
|
||||
rx_size = min_t(u32, rx_size, MLX4_EN_MAX_RX_SIZE);
|
||||
tx_size = roundup_pow_of_two(param->tx_pending);
|
||||
tx_size = max_t(u32, tx_size, MLX4_EN_MIN_TX_SIZE);
|
||||
tx_size = min_t(u32, tx_size, MLX4_EN_MAX_TX_SIZE);
|
||||
|
||||
if (rx_size == priv->prof->rx_ring_size &&
|
||||
tx_size == priv->prof->tx_ring_size)
|
||||
@ -440,8 +442,8 @@ static void mlx4_en_get_ringparam(struct net_device *dev,
|
||||
struct mlx4_en_dev *mdev = priv->mdev;
|
||||
|
||||
memset(param, 0, sizeof(*param));
|
||||
param->rx_max_pending = mdev->dev->caps.max_rq_sg;
|
||||
param->tx_max_pending = mdev->dev->caps.max_sq_sg;
|
||||
param->rx_max_pending = MLX4_EN_MAX_RX_SIZE;
|
||||
param->tx_max_pending = MLX4_EN_MAX_TX_SIZE;
|
||||
param->rx_pending = mdev->profile.prof[priv->port].rx_ring_size;
|
||||
param->tx_pending = mdev->profile.prof[priv->port].tx_ring_size;
|
||||
}
|
||||
|
@ -115,6 +115,10 @@ enum {
|
||||
};
|
||||
#define MLX4_EN_MAX_RX_FRAGS 4
|
||||
|
||||
/* Maximum ring sizes */
|
||||
#define MLX4_EN_MAX_TX_SIZE 8192
|
||||
#define MLX4_EN_MAX_RX_SIZE 8192
|
||||
|
||||
/* Minimum ring size for our page-allocation sceme to work */
|
||||
#define MLX4_EN_MIN_RX_SIZE (MLX4_EN_ALLOC_SIZE / SMP_CACHE_BYTES)
|
||||
#define MLX4_EN_MIN_TX_SIZE (4096 / TXBB_SIZE)
|
||||
|
Loading…
Reference in New Issue
Block a user