Skip to content

Commit 0292054

Browse files
Dotan BarakSomasundaram Krishnasamy
authored andcommitted
mlx4_core: limit min profile numbers
We can't use arbitrarily low profile numbers for resources since the device needs some of its own. The best way to do it is to query the device and then set the minimum values, but the values chosen here are good enough and do not complicate the implementation. Signed-off-by: Eli Cohen <[email protected]> Signed-off-by: Dotan Barak <[email protected]> Reviewed-by: Jack Morgenstein <[email protected]> Signed-off-by: Vladimir Sokolovsky <[email protected]> (Ported from Mellanox OFED 2.4) Signed-off-by: Mukesh Kacker <[email protected]> Orabug: 27510508 (cherry picked from commit 03d8d9f) cherry-pick-repo=linux-uek.git Signed-off-by: Qing Huang <[email protected]> Reviewed-by: Yuval Shaia <[email protected]> Signed-off-by: Aron Silverton <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent 91363f0 commit 0292054

File tree

1 file changed

+30
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx4

1 file changed

+30
-0
lines changed

drivers/net/ethernet/mellanox/mlx4/main.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4340,6 +4340,36 @@ static int __init mlx4_verify_params(void)
43404340
return -1;
43414341
}
43424342

4343+
if (mod_param_profile.num_qp < 12 || mod_param_profile.num_qp > 23) {
4344+
pr_warning("mlx4_core: bad log_num_qp: %d\n",
4345+
mod_param_profile.num_qp);
4346+
return -1;
4347+
}
4348+
4349+
if (mod_param_profile.num_srq < 10) {
4350+
pr_warning("mlx4_core: too low log_num_srq: %d\n",
4351+
mod_param_profile.num_srq);
4352+
return -1;
4353+
}
4354+
4355+
if (mod_param_profile.num_cq < 10) {
4356+
pr_warning("mlx4_core: too low log_num_cq: %d\n",
4357+
mod_param_profile.num_cq);
4358+
return -1;
4359+
}
4360+
4361+
if (mod_param_profile.num_mpt < 10) {
4362+
pr_warning("mlx4_core: too low log_num_mpt: %d\n",
4363+
mod_param_profile.num_mpt);
4364+
return -1;
4365+
}
4366+
4367+
if (mod_param_profile.num_mtt && mod_param_profile.num_mtt < 15) {
4368+
pr_warning("mlx4_core: too low log_num_mtt: %d\n",
4369+
mod_param_profile.num_mtt);
4370+
return -1;
4371+
}
4372+
43434373
return 0;
43444374
}
43454375

0 commit comments

Comments
 (0)