]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mlx4_core: Change the name of the num_mtt in mlx4_profile to be num_mtt_segs.
authorMajd Dibbiny <majd@mellanox.com>
Mon, 23 Sep 2013 10:52:08 +0000 (13:52 +0300)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 7 Jul 2015 21:45:17 +0000 (14:45 -0700)
The old name is misleading. The variable is the number of mtt
segments and not the number of mtts so it was changed to match
the actual meaning.

Signed-off-by: Majd Dibbiny <majd@mellanox.com>
(Ported from Mellanox OFED 2.4)

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

index 347779bf5c60fd0f64243d6cd1bd7ce35f211f78..1d12b67631743de8292432639d5dccd230a52d9e 100644 (file)
@@ -121,7 +121,7 @@ static struct mlx4_profile low_mem_profile = {
        .num_cq         = 1 << 8,
        .num_mcg        = 1 << 8,
        .num_mpt        = 1 << 9,
-       .num_mtt        = 1 << 7,
+       .num_mtt_segs   = 1 << 7,
 };
 
 static int log_num_mac = 7;
@@ -171,7 +171,7 @@ static struct mlx4_profile mod_param_profile = {
        .num_cq         = 16,
        .num_mcg        = 13,
        .num_mpt        = 19,
-       .num_mtt        = 0, /* max(20, 2*MTTs for host memory)) */
+       .num_mtt_segs   = 0, /* max(20, 2*MTTs for host memory)) */
 };
 
 module_param_named(log_num_qp, mod_param_profile.num_qp, int, 0444);
@@ -198,7 +198,7 @@ MODULE_PARM_DESC(log_num_mpt,
                 "log maximum number of memory protection table entries per "
                 "HCA (default: 19)");
 
-module_param_named(log_num_mtt, mod_param_profile.num_mtt, int, 0444);
+module_param_named(log_num_mtt, mod_param_profile.num_mtt_segs, int, 0444);
 MODULE_PARM_DESC(log_num_mtt,
                 "log maximum number of memory translation table segments per "
                 "HCA (default: max(20, 2*MTTs for register all of the host memory limited to 30))");
@@ -230,11 +230,11 @@ static void process_mod_param_profile(struct mlx4_profile *profile)
         * That limits us to 4TB of memory registration per HCA with
         * 4KB pages, which is probably OK for the next few months.
         */
-       if (mod_param_profile.num_mtt)
-               profile->num_mtt = 1 << mod_param_profile.num_mtt;
+       if (mod_param_profile.num_mtt_segs)
+               profile->num_mtt_segs = 1 << mod_param_profile.num_mtt_segs;
        else {
                si_meminfo(&si);
-               profile->num_mtt =
+               profile->num_mtt_segs =
                        roundup_pow_of_two(max_t(unsigned,
                                                1 << (MLX4_LOG_NUM_MTT -
                                                      log_mtts_per_seg),
@@ -245,7 +245,7 @@ static void process_mod_param_profile(struct mlx4_profile *profile)
                                                >> 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);
+               mod_param_profile.num_mtt_segs = ilog2(profile->num_mtt_segs);
        }
 }
 
@@ -3857,15 +3857,16 @@ static int __init mlx4_verify_params(void)
                return -1;
        }
 
-       if (mod_param_profile.num_mtt && mod_param_profile.num_mtt < 15) {
+       if (mod_param_profile.num_mtt_segs &&
+           mod_param_profile.num_mtt_segs < 15) {
                pr_warning("mlx4_core: too low log_num_mtt: %d\n",
-                          mod_param_profile.num_mtt);
+                          mod_param_profile.num_mtt_segs);
                return -1;
        }
 
-       if (mod_param_profile.num_mtt > MLX4_MAX_LOG_NUM_MTT) {
+       if (mod_param_profile.num_mtt_segs > MLX4_MAX_LOG_NUM_MTT) {
                pr_warning("mlx4_core: too high log_num_mtt: %d\n",
-                          mod_param_profile.num_mtt);
+                          mod_param_profile.num_mtt_segs);
                return -1;
        }
        return 0;
index 6ce6e9ad14fcd36e6d7ecd3311441736a14167ae..84d1cfe8113f045c29860213eb9cb6765a2cc864 100644 (file)
@@ -410,7 +410,7 @@ struct mlx4_profile {
        int                     num_cq;
        int                     num_mcg;
        int                     num_mpt;
-       unsigned                num_mtt;
+       unsigned                num_mtt_segs;
 };
 
 struct mlx4_fw {
index 612c56cfd77ab9f419aabbe3635ea1268da575c8..412da7b12afbbf82f7205386a2b90370c059d2b3 100644 (file)
@@ -111,7 +111,8 @@ u64 mlx4_make_profile(struct mlx4_dev *dev,
                                        min_t(unsigned, dev_cap->max_eqs, MAX_MSIX);
        profile[MLX4_RES_DMPT].num    = request->num_mpt;
        profile[MLX4_RES_CMPT].num    = MLX4_NUM_CMPTS;
-       profile[MLX4_RES_MTT].num     = ((u64)request->num_mtt) * (1 << log_mtts_per_seg);
+       profile[MLX4_RES_MTT].num     = ((u64)request->num_mtt_segs) *
+                                       (1 << log_mtts_per_seg);
        profile[MLX4_RES_MCG].num     = request->num_mcg;
 
        for (i = 0; i < MLX4_RES_NUM; ++i) {