Skip to content

Commit 18d971f

Browse files
noaosgregkh
authored andcommitted
net/mlx5: Check FW limitations on log_max_qp before setting it
[ Upstream commit 883371c453b937f9eb581fb4915210865982736f ] When setting HCA capabilities, set log_max_qp to be the minimum between the selected profile's value and the HCA limitation. Fixes: 938fe83 ('net/mlx5_core: New device capabilities...') Signed-off-by: Noa Osherovich <noaos@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3f28476 commit 18d971f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • drivers/net/ethernet/mellanox/mlx5/core

drivers/net/ethernet/mellanox/mlx5/core/main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,13 @@ static int handle_hca_cap(struct mlx5_core_dev *dev)
432432
MLX5_SET(cmd_hca_cap, set_hca_cap, pkey_table_size,
433433
to_fw_pkey_sz(128));
434434

435+
/* Check log_max_qp from HCA caps to set in current profile */
436+
if (MLX5_CAP_GEN_MAX(dev, log_max_qp) < profile[prof_sel].log_max_qp) {
437+
mlx5_core_warn(dev, "log_max_qp value in current profile is %d, changing it to HCA capability limit (%d)\n",
438+
profile[prof_sel].log_max_qp,
439+
MLX5_CAP_GEN_MAX(dev, log_max_qp));
440+
profile[prof_sel].log_max_qp = MLX5_CAP_GEN_MAX(dev, log_max_qp);
441+
}
435442
if (prof->mask & MLX5_PROF_MASK_QP_SIZE)
436443
MLX5_SET(cmd_hca_cap, set_hca_cap, log_max_qp,
437444
prof->log_max_qp);

0 commit comments

Comments
 (0)