From: Dotan Barak Date: Tue, 21 Aug 2012 09:11:31 +0000 (+0300) Subject: net/mlx4_core: set used number of MTTs when using auto-detection X-Git-Tag: v4.1.12-92~293^2~1^2~108 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7d636db2af768fe4500b4eaae20fc61dfcd03215;p=users%2Fjedix%2Flinux-maple.git 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 --- 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)); } }