mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-10 07:44:23 +08:00
net/mlx4_en: Use minimal rx and tx ring sizes on kdump kernel
When memory is limited (on kdump kernel), reduce size of rx and tx rings. Also reduce the number of rx rings. Signed-off-by: Alaa Hleihel <alaa@mellanox.com> Signed-off-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
071a234ad7
commit
27055454b4
@ -167,8 +167,13 @@ static void mlx4_en_get_profile(struct mlx4_en_dev *mdev)
|
||||
params->prof[i].rx_ppp = pfcrx;
|
||||
params->prof[i].tx_pause = !(pfcrx || pfctx);
|
||||
params->prof[i].tx_ppp = pfctx;
|
||||
params->prof[i].tx_ring_size = MLX4_EN_DEF_TX_RING_SIZE;
|
||||
params->prof[i].rx_ring_size = MLX4_EN_DEF_RX_RING_SIZE;
|
||||
if (mlx4_low_memory_profile()) {
|
||||
params->prof[i].tx_ring_size = MLX4_EN_MIN_TX_SIZE;
|
||||
params->prof[i].rx_ring_size = MLX4_EN_MIN_RX_SIZE;
|
||||
} else {
|
||||
params->prof[i].tx_ring_size = MLX4_EN_DEF_TX_RING_SIZE;
|
||||
params->prof[i].rx_ring_size = MLX4_EN_DEF_RX_RING_SIZE;
|
||||
}
|
||||
params->prof[i].num_up = MLX4_EN_NUM_UP_LOW;
|
||||
params->prof[i].num_tx_rings_p_up = params->max_num_tx_rings_p_up;
|
||||
params->prof[i].tx_ring_num[TX] = params->max_num_tx_rings_p_up *
|
||||
|
@ -72,7 +72,7 @@
|
||||
#define MLX4_EN_PAGE_SIZE (1 << MLX4_EN_PAGE_SHIFT)
|
||||
#define DEF_RX_RINGS 16
|
||||
#define MAX_RX_RINGS 128
|
||||
#define MIN_RX_RINGS 4
|
||||
#define MIN_RX_RINGS 1
|
||||
#define LOG_TXBB_SIZE 6
|
||||
#define TXBB_SIZE BIT(LOG_TXBB_SIZE)
|
||||
#define HEADROOM (2048 / TXBB_SIZE + 1)
|
||||
|
Loading…
Reference in New Issue
Block a user