Skip to content

Commit 03d8d9f

Browse files
Dotan BarakMukesh Kacker
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]>
1 parent 08c75b2 commit 03d8d9f

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
@@ -3781,6 +3781,36 @@ static int __init mlx4_verify_params(void)
37813781
return -1;
37823782
}
37833783

3784+
if (mod_param_profile.num_qp < 12 || mod_param_profile.num_qp > 23) {
3785+
pr_warning("mlx4_core: bad log_num_qp: %d\n",
3786+
mod_param_profile.num_qp);
3787+
return -1;
3788+
}
3789+
3790+
if (mod_param_profile.num_srq < 10) {
3791+
pr_warning("mlx4_core: too low log_num_srq: %d\n",
3792+
mod_param_profile.num_srq);
3793+
return -1;
3794+
}
3795+
3796+
if (mod_param_profile.num_cq < 10) {
3797+
pr_warning("mlx4_core: too low log_num_cq: %d\n",
3798+
mod_param_profile.num_cq);
3799+
return -1;
3800+
}
3801+
3802+
if (mod_param_profile.num_mpt < 10) {
3803+
pr_warning("mlx4_core: too low log_num_mpt: %d\n",
3804+
mod_param_profile.num_mpt);
3805+
return -1;
3806+
}
3807+
3808+
if (mod_param_profile.num_mtt && mod_param_profile.num_mtt < 15) {
3809+
pr_warning("mlx4_core: too low log_num_mtt: %d\n",
3810+
mod_param_profile.num_mtt);
3811+
return -1;
3812+
}
3813+
37843814
return 0;
37853815
}
37863816

0 commit comments

Comments
 (0)