Skip to content

Commit 2705545

Browse files
alaahldavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 071a234 commit 2705545

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

drivers/net/ethernet/mellanox/mlx4/en_main.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,13 @@ static void mlx4_en_get_profile(struct mlx4_en_dev *mdev)
167167
params->prof[i].rx_ppp = pfcrx;
168168
params->prof[i].tx_pause = !(pfcrx || pfctx);
169169
params->prof[i].tx_ppp = pfctx;
170-
params->prof[i].tx_ring_size = MLX4_EN_DEF_TX_RING_SIZE;
171-
params->prof[i].rx_ring_size = MLX4_EN_DEF_RX_RING_SIZE;
170+
if (mlx4_low_memory_profile()) {
171+
params->prof[i].tx_ring_size = MLX4_EN_MIN_TX_SIZE;
172+
params->prof[i].rx_ring_size = MLX4_EN_MIN_RX_SIZE;
173+
} else {
174+
params->prof[i].tx_ring_size = MLX4_EN_DEF_TX_RING_SIZE;
175+
params->prof[i].rx_ring_size = MLX4_EN_DEF_RX_RING_SIZE;
176+
}
172177
params->prof[i].num_up = MLX4_EN_NUM_UP_LOW;
173178
params->prof[i].num_tx_rings_p_up = params->max_num_tx_rings_p_up;
174179
params->prof[i].tx_ring_num[TX] = params->max_num_tx_rings_p_up *

drivers/net/ethernet/mellanox/mlx4/mlx4_en.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
#define MLX4_EN_PAGE_SIZE (1 << MLX4_EN_PAGE_SHIFT)
7373
#define DEF_RX_RINGS 16
7474
#define MAX_RX_RINGS 128
75-
#define MIN_RX_RINGS 4
75+
#define MIN_RX_RINGS 1
7676
#define LOG_TXBB_SIZE 6
7777
#define TXBB_SIZE BIT(LOG_TXBB_SIZE)
7878
#define HEADROOM (2048 / TXBB_SIZE + 1)

0 commit comments

Comments
 (0)