]> git.baikalelectronics.ru Git - kernel.git/commit
mlx4_core: Fix integer overflows so 8TBs of memory registration works
authorYishai Hadas <yishaih@mellanox.com>
Wed, 29 Aug 2012 15:14:35 +0000 (15:14 +0000)
committerRoland Dreier <roland@purestorage.com>
Fri, 14 Sep 2012 00:52:02 +0000 (17:52 -0700)
commit29de44e2def693bbdd32e28698628810512edae8
treebfccd072c4492919bd29c4c2cbf85847a1c21a12
parentb606b61489dced42a88c3f6bff0b74f751da4b86
mlx4_core: Fix integer overflows so 8TBs of memory registration works

This patch adds on the fixes done in commits 6761f9e8708b ("mlx4_core:
Allow large mlx4_buddy bitmaps") and c8556eaff3dc ("mlx4_core: Fix
integer overflow issues around MTT table") so that memory registration
of up to 8TB (log_num_mtt=31) finally works.

It fixes integer overflows in a few mlx4_table_yyy routines in icm.c
by using a u64 intermediate variable, and int/uint issues that caused
table indexes to become nagive by setting some variables to be u32
instead of int.  These problems cause crashes when a user attempted to
register > 512GB of RAM.

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/icm.c
drivers/net/ethernet/mellanox/mlx4/icm.h