]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net/mlx4_core: num mtt issues
authorYishai Hadas <yishaih@mellanox.com>
Mon, 19 Nov 2012 13:59:08 +0000 (15:59 +0200)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 7 Jul 2015 21:45:03 +0000 (14:45 -0700)
consider num mtts per segment
use vmalloc only when kmalloc fails

V2: adjusted for kernel 3.7-rc4
use vmalloc only when kmalloc fails -- already in kernel:
see commit 89dd86db7 --mlx4_core: Allow large mlx4_buddy bitmaps

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Jack Morgenstein <jackm@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 35f455d53b640f04b43674c4f2aa667ae2431a44..9d7b4feae5bd2627fc9add4f8a34d7e28ce74759 100644 (file)
@@ -160,9 +160,6 @@ struct mlx4_port_config {
 static atomic_t pf_loading = ATOMIC_INIT(0);
 
 #define MLX4_LOG_NUM_MTT 20
-/* When a higher value than 28 is used we get a failure via initializing
-     the event queue table.
-*/
 #define MLX4_MAX_LOG_NUM_MTT 28
 static struct mlx4_profile mod_param_profile = {
        .num_qp         = 18,
@@ -221,8 +218,8 @@ static void process_mod_param_profile(struct mlx4_profile *profile)
         * memory (with PAGE_SIZE entries).
         *
         * This number has to be a power of two and fit into 32 bits
-        * due to device limitations, so cap this at 2^31 as well.
-        * That limits us to 8TB of memory registration per HCA with
+        * due to device limitations, so cap this at 2^28 as well.
+        * That limits us to 1TB of memory registration per HCA with
         * 4KB pages, which is probably OK for the next few months.
         */
        if (mod_param_profile.num_mtt)
@@ -232,7 +229,9 @@ static void process_mod_param_profile(struct mlx4_profile *profile)
                profile->num_mtt =
                        roundup_pow_of_two(max_t(unsigned,
                                                1 << MLX4_LOG_NUM_MTT,
-                                               min(1UL << MLX4_MAX_LOG_NUM_MTT,
+                                               min(1UL <<
+                                               (MLX4_MAX_LOG_NUM_MTT -
+                                               log_mtts_per_seg),
                                                (si.totalram << 1)
                                                >> log_mtts_per_seg)));
        }