]> git.baikalelectronics.ru Git - kernel.git/commit
mlx4_core: Allow large mlx4_buddy bitmaps
authorYishai Hadas <yishaih@mellanox.com>
Mon, 13 Aug 2012 08:15:06 +0000 (08:15 +0000)
committerRoland Dreier <roland@purestorage.com>
Thu, 16 Aug 2012 04:05:20 +0000 (21:05 -0700)
commit267db343326ba09d8d437d539fba929b31a32b01
treee2c69177fd4478c398547e81d5da2b61a1cd2158
parent955c570aac75ad9208ecf557213b575f6cdefe74
mlx4_core: Allow large mlx4_buddy bitmaps

mlx4_buddy_init uses kmalloc() to allocate bitmaps, which fails when
the required size is beyond the max supported value (or when memory is
too fragmented to handle a huge allocation).  Extend this to use use
vmalloc() if kmalloc() fails, and take that into account when freeing
the bitmaps as well.

This fixes a driver load failure when log num mtt is 26 or higher, and
is a step in the direction of allowing to register huge amounts of
memory on large memory systems.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/net/ethernet/mellanox/mlx4/mr.c