From dc9a035610a00356ca297464824ca48c7b76dd13 Mon Sep 17 00:00:00 2001 From: Yishai Hadas Date: Mon, 19 Nov 2012 15:59:08 +0200 Subject: [PATCH] net/mlx4_core: num mtt issues consider num mtts per segment use vmalloc only when kmalloc fails V2: adjusted for kernel 3.7-rc4 use vmalloc only when kmalloc fails -- already in kernel: see commit 89dd86db7 --mlx4_core: Allow large mlx4_buddy bitmaps Signed-off-by: Yishai Hadas Signed-off-by: Jack Morgenstein (Ported from Mellanox OFED 2.4) Signed-off-by: Mukesh Kacker --- drivers/net/ethernet/mellanox/mlx4/main.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 35f455d53b64..9d7b4feae5bd 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c @@ -160,9 +160,6 @@ struct mlx4_port_config { static atomic_t pf_loading = ATOMIC_INIT(0); #define MLX4_LOG_NUM_MTT 20 -/* When a higher value than 28 is used we get a failure via initializing - the event queue table. -*/ #define MLX4_MAX_LOG_NUM_MTT 28 static struct mlx4_profile mod_param_profile = { .num_qp = 18, @@ -221,8 +218,8 @@ static void process_mod_param_profile(struct mlx4_profile *profile) * memory (with PAGE_SIZE entries). * * This number has to be a power of two and fit into 32 bits - * due to device limitations, so cap this at 2^31 as well. - * That limits us to 8TB of memory registration per HCA with + * due to device limitations, so cap this at 2^28 as well. + * That limits us to 1TB of memory registration per HCA with * 4KB pages, which is probably OK for the next few months. */ if (mod_param_profile.num_mtt) @@ -232,7 +229,9 @@ static void process_mod_param_profile(struct mlx4_profile *profile) profile->num_mtt = roundup_pow_of_two(max_t(unsigned, 1 << MLX4_LOG_NUM_MTT, - min(1UL << MLX4_MAX_LOG_NUM_MTT, + min(1UL << + (MLX4_MAX_LOG_NUM_MTT - + log_mtts_per_seg), (si.totalram << 1) >> log_mtts_per_seg))); } -- 2.50.1