mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-13 01:44:28 +00:00
net/mlx4_en: Reduce memory consumption on kdump kernel
When memory is limited, reduce number of rx and tx rings. Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2599d8580f
commit
ea1c1af139
3 changed files with 8 additions and 4 deletions
|
@ -129,8 +129,10 @@ static int mlx4_en_get_profile(struct mlx4_en_dev *mdev)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
params->udp_rss = udp_rss;
|
params->udp_rss = udp_rss;
|
||||||
params->num_tx_rings_p_up = min_t(int, num_online_cpus(),
|
params->num_tx_rings_p_up = mlx4_low_memory_profile() ?
|
||||||
MLX4_EN_MAX_TX_RING_P_UP);
|
MLX4_EN_MIN_TX_RING_P_UP :
|
||||||
|
min_t(int, num_online_cpus(), MLX4_EN_MAX_TX_RING_P_UP);
|
||||||
|
|
||||||
if (params->udp_rss && !(mdev->dev->caps.flags
|
if (params->udp_rss && !(mdev->dev->caps.flags
|
||||||
& MLX4_DEV_CAP_FLAG_UDP_RSS)) {
|
& MLX4_DEV_CAP_FLAG_UDP_RSS)) {
|
||||||
mlx4_warn(mdev, "UDP RSS is not supported on this device\n");
|
mlx4_warn(mdev, "UDP RSS is not supported on this device\n");
|
||||||
|
|
|
@ -335,8 +335,9 @@ void mlx4_en_set_num_rx_rings(struct mlx4_en_dev *mdev)
|
||||||
dev->caps.comp_pool/
|
dev->caps.comp_pool/
|
||||||
dev->caps.num_ports) - 1;
|
dev->caps.num_ports) - 1;
|
||||||
|
|
||||||
num_rx_rings = min_t(int, num_of_eqs,
|
num_rx_rings = mlx4_low_memory_profile() ? MIN_RX_RINGS :
|
||||||
netif_get_num_default_rss_queues());
|
min_t(int, num_of_eqs,
|
||||||
|
netif_get_num_default_rss_queues());
|
||||||
mdev->profile.prof[i].rx_ring_num =
|
mdev->profile.prof[i].rx_ring_num =
|
||||||
rounddown_pow_of_two(num_rx_rings);
|
rounddown_pow_of_two(num_rx_rings);
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,6 +121,7 @@ enum {
|
||||||
#define MLX4_EN_MIN_TX_SIZE (4096 / TXBB_SIZE)
|
#define MLX4_EN_MIN_TX_SIZE (4096 / TXBB_SIZE)
|
||||||
|
|
||||||
#define MLX4_EN_SMALL_PKT_SIZE 64
|
#define MLX4_EN_SMALL_PKT_SIZE 64
|
||||||
|
#define MLX4_EN_MIN_TX_RING_P_UP 1
|
||||||
#define MLX4_EN_MAX_TX_RING_P_UP 32
|
#define MLX4_EN_MAX_TX_RING_P_UP 32
|
||||||
#define MLX4_EN_NUM_UP 8
|
#define MLX4_EN_NUM_UP 8
|
||||||
#define MLX4_EN_DEF_TX_RING_SIZE 512
|
#define MLX4_EN_DEF_TX_RING_SIZE 512
|
||||||
|
|
Loading…
Add table
Reference in a new issue