Skip to content

Commit d0ea789

Browse files
msanallanathan-zcgao
authored andcommitted
net/mlx5: Update log_max_qp value to FW max capability
commit f79a609 upstream. log_max_qp in driver's default profile #2 was set to 18, but FW actually supports 17 at the most - a situation that led to the concerning print when the driver is loaded: "log_max_qp value in current profile is 18, changing to HCA capabaility limit (17)" The expected behavior from mlx5_profile #2 is to match the maximum FW capability in regards to log_max_qp. Thus, log_max_qp in profile #2 is initialized to a defined static value (0xff) - which basically means that when loading this profile, log_max_qp value will be what the currently installed FW supports at most. Signed-off-by: Maher Sanalla <msanalla@nvidia.com> Reviewed-by: Maor Gottlieb <maorg@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> [v5.10: replaced prof->log_max_qp with profile[prof_sel].log_max_qp] Signed-off-by: Shaoying Xu <shaoyi@amazon.com>
1 parent b64b491 commit d0ea789

File tree

1 file changed

+6
-2
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ enum {
9494
MLX5_ATOMIC_REQ_MODE_HOST_ENDIANNESS = 0x1,
9595
};
9696

97+
#define LOG_MAX_SUPPORTED_QPS 0xff
98+
9799
static struct mlx5_profile profile[] = {
98100
[0] = {
99101
.mask = 0,
@@ -105,7 +107,7 @@ static struct mlx5_profile profile[] = {
105107
[2] = {
106108
.mask = MLX5_PROF_MASK_QP_SIZE |
107109
MLX5_PROF_MASK_MR_CACHE,
108-
.log_max_qp = 18,
110+
.log_max_qp = LOG_MAX_SUPPORTED_QPS,
109111
.mr_cache[0] = {
110112
.size = 500,
111113
.limit = 250
@@ -522,7 +524,9 @@ static int handle_hca_cap(struct mlx5_core_dev *dev, void *set_ctx)
522524
to_fw_pkey_sz(dev, 128));
523525

524526
/* Check log_max_qp from HCA caps to set in current profile */
525-
if (MLX5_CAP_GEN_MAX(dev, log_max_qp) < profile[prof_sel].log_max_qp) {
527+
if (profile[prof_sel].log_max_qp == LOG_MAX_SUPPORTED_QPS) {
528+
profile[prof_sel].log_max_qp = MLX5_CAP_GEN_MAX(dev, log_max_qp);
529+
} else if (MLX5_CAP_GEN_MAX(dev, log_max_qp) < profile[prof_sel].log_max_qp) {
526530
mlx5_core_warn(dev, "log_max_qp value in current profile is %d, changing it to HCA capability limit (%d)\n",
527531
profile[prof_sel].log_max_qp,
528532
MLX5_CAP_GEN_MAX(dev, log_max_qp));

0 commit comments

Comments
 (0)