]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net/mlx4_core: set used number of MTTs when using auto-detection
authorDotan Barak <dotanb@dev.mellanox.co.il>
Tue, 21 Aug 2012 09:11:31 +0000 (12:11 +0300)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 7 Jul 2015 21:45:04 +0000 (14:45 -0700)
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 <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 738dbb0696060441acb1252aefc8e17ff08cdee5..f6031f0437c3fe5f5f401287abdf7b6e418bc531 100644 (file)
@@ -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));
        }
 }