提交 5a2e87b1 编写于 作者: J Jack Morgenstein 提交者: David S. Miller

net/mlx4_core: Fix kernel Oops (mem corruption) when working with more than 80 VFs

Commit de966c59 (net/mlx4_core: Support more than 64 VFs) was meant to
allow up to 126 VFs.  However, due to leaving MLX4_MFUNC_MAX too low, using
more than 80 VFs resulted in memory corruptions (and Oopses) when more than
80 VFs were requested. In addition, the number of slaves was left too high.

This commit fixes these issues.

Fixes: de966c59 ("net/mlx4_core: Support more than 64 VFs")
Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: NAmir Vadai <amirv@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c101cff9
...@@ -235,7 +235,8 @@ do { \ ...@@ -235,7 +235,8 @@ do { \
extern int mlx4_log_num_mgm_entry_size; extern int mlx4_log_num_mgm_entry_size;
extern int log_mtts_per_seg; extern int log_mtts_per_seg;
#define MLX4_MAX_NUM_SLAVES (MLX4_MAX_NUM_PF + MLX4_MAX_NUM_VF) #define MLX4_MAX_NUM_SLAVES (min(MLX4_MAX_NUM_PF + MLX4_MAX_NUM_VF, \
MLX4_MFUNC_MAX))
#define ALL_SLAVES 0xff #define ALL_SLAVES 0xff
struct mlx4_bitmap { struct mlx4_bitmap {
......
...@@ -97,7 +97,7 @@ enum { ...@@ -97,7 +97,7 @@ enum {
MLX4_MAX_NUM_PF = 16, MLX4_MAX_NUM_PF = 16,
MLX4_MAX_NUM_VF = 126, MLX4_MAX_NUM_VF = 126,
MLX4_MAX_NUM_VF_P_PORT = 64, MLX4_MAX_NUM_VF_P_PORT = 64,
MLX4_MFUNC_MAX = 80, MLX4_MFUNC_MAX = 128,
MLX4_MAX_EQ_NUM = 1024, MLX4_MAX_EQ_NUM = 1024,
MLX4_MFUNC_EQ_NUM = 4, MLX4_MFUNC_EQ_NUM = 4,
MLX4_MFUNC_MAX_EQES = 8, MLX4_MFUNC_MAX_EQES = 8,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册