]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net/mlx4_core: the number of MTTs should consider log_mtts_per_seg
authorDotan Barak <dotanb@dev.mellanox.co.il>
Tue, 21 Aug 2012 08:56:46 +0000 (11:56 +0300)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 7 Jul 2015 21:45:04 +0000 (14:45 -0700)
No matter how we decided how many MTTs will be used (calculation
from system memory or using default value), we need to consider
the number of MTTs per segment.

This will allow the user to specify how many MTTs will be used
(with log_num_mtt) and how many MTTs will be used per segment
(using log_mtts_per_seg).

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
drivers/net/ethernet/mellanox/mlx4/main.c

index 14eda84599a17b3a784a81b6155e37830c10e9f2..738dbb0696060441acb1252aefc8e17ff08cdee5 100644 (file)
@@ -232,7 +232,8 @@ static void process_mod_param_profile(struct mlx4_profile *profile)
                si_meminfo(&si);
                profile->num_mtt =
                        roundup_pow_of_two(max_t(unsigned,
-                                               1 << MLX4_LOG_NUM_MTT,
+                                               1 << (MLX4_LOG_NUM_MTT -
+                                                     log_mtts_per_seg),
                                                min(1UL <<
                                                (MLX4_MAX_LOG_NUM_MTT -
                                                log_mtts_per_seg),