From 7d636db2af768fe4500b4eaae20fc61dfcd03215 Mon Sep 17 00:00:00 2001 From: Dotan Barak Date: Tue, 21 Aug 2012 12:11:31 +0300 Subject: [PATCH] net/mlx4_core: set used number of MTTs when using auto-detection Issue 31158. If we set the number of MTTs automatically by the driver (default value or auto-detection, by the memory size in the machine), need to set the used value of the MTTs, so the user will see this value. Signed-off-by: Dotan Barak Reviewed-by: Yishai Hadas (Ported from Mellanox OFED 2.4) Signed-off-by: Mukesh Kacker --- drivers/net/ethernet/mellanox/mlx4/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 738dbb069606..f6031f0437c3 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c @@ -239,6 +239,9 @@ static void process_mod_param_profile(struct mlx4_profile *profile) log_mtts_per_seg), (si.totalram << 1) >> log_mtts_per_seg))); + /* set the actual value, so it will be reflected to the user + using the sysfs */ + mod_param_profile.num_mtt = ilog2(profile->num_mtt * (1 << log_mtts_per_seg)); } } -- 2.50.1