Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3718956pxb; Mon, 24 Jan 2022 16:14:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwm7BhD6347L/p4VZK/4KKCOx2Ljuk8l+HnL7nsiL9JLn75/lgkVJADgcYcckp0encdrM/V X-Received: by 2002:a63:7946:: with SMTP id u67mr13248412pgc.83.1643069679754; Mon, 24 Jan 2022 16:14:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643069679; cv=none; d=google.com; s=arc-20160816; b=nq0KefPGuobWO2TgTsURJAd8CDjHxrLCtTH+nbLePan32OLSLEpEusjK6c5zIR6Asd Ys4rVAnXDAX1+jGk4J9/1zmBBkW8KCn7+xBBrTEExT80UQC6jh1XR7DckDe9wSBxa5+Y Tymm/tXLhrtyhwjBCQjleJK2a0eXCWot2HYd9nkoxxmPT8syaCcVuA4Gb/AVNMCipRDd psKOFiL1FUxTetbD//UujSO41mmRrbHKnDKfHeTuuvn+RyVod4YTKhji0i32uQd6w9wb n3HFMGfWOJc6HryTWhn3ZbxN47nOfDEKN+/99+tJLKxuPAHr+hRu1jm13ORazTJlisFo 7TXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zzL1vYlnbAZfxRuZqHZlaWxvT9HGYhEtF+COaZ4BaQU=; b=kch+0XVKgzWvaprtx2ctH/4vQ5am+Idy7RutDhAevSM42toUHQ/OgtFVCNaCVBYjW6 VmuPVDsEOibNI7UVlJV5tkcbl/Dy8qDZGOLFiycM5MkxEk3bBjmfCecsM8K1ohaobQCy hPbEWim7rcjQqRrGqVLtl1SFnhMi7UmGcrh65n5dijfeVBlDCJJ+D6+XUF7Q6EhPSvhK +jVfuwk6qslhwWIHTF3c86bitDdm3eICK+FdS2Wzi6DFT4EPFhsq3emK6sG54Zqwq4Kn wKdFywyT+lwX1RBc810NY759EUrxqdPeSNuiESsoj1eBkCRwtvkTFaD6ugaaAGJ1gBxK bfUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yKVshzFc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z5si30483plk.433.2022.01.24.16.14.23; Mon, 24 Jan 2022 16:14:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yKVshzFc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2372433AbiAYAL3 (ORCPT + 99 others); Mon, 24 Jan 2022 19:11:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1848969AbiAXXY2 (ORCPT ); Mon, 24 Jan 2022 18:24:28 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B83BC0730BF; Mon, 24 Jan 2022 13:29:46 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CD588B80CCF; Mon, 24 Jan 2022 21:29:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 099B9C340E4; Mon, 24 Jan 2022 21:29:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059783; bh=1yXJMUXEkxTPzr5/L/0e1NWZ8NvwKPJ/QiqyCsCia7E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yKVshzFceF4thddfMGGS7GyxSLNwHlAILduGpZA7mGQYt3Hq87wYUojG1URaqaU1I nh80ZBGzCIiboA+8rMpbyZ1wlEswSDi88oy4JIFzKaEKc5b9CAVWtMEJw9PgH8zF6F QHPAy2t9H+Ht34nxNomWandTLLgpQQAMhaTOuIrw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maher Sanalla , Maor Gottlieb , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.16 0725/1039] net/mlx5: Update log_max_qp value to FW max capability Date: Mon, 24 Jan 2022 19:41:54 +0100 Message-Id: <20220124184149.698711111@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maher Sanalla [ Upstream commit f79a609ea6bf54ad2d2c24e4de4524288b221666 ] 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 Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index 65083496f9131..6e381111f1d2f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -98,6 +98,8 @@ enum { MLX5_ATOMIC_REQ_MODE_HOST_ENDIANNESS = 0x1, }; +#define LOG_MAX_SUPPORTED_QPS 0xff + static struct mlx5_profile profile[] = { [0] = { .mask = 0, @@ -109,7 +111,7 @@ static struct mlx5_profile profile[] = { [2] = { .mask = MLX5_PROF_MASK_QP_SIZE | MLX5_PROF_MASK_MR_CACHE, - .log_max_qp = 18, + .log_max_qp = LOG_MAX_SUPPORTED_QPS, .mr_cache[0] = { .size = 500, .limit = 250 @@ -507,7 +509,9 @@ static int handle_hca_cap(struct mlx5_core_dev *dev, void *set_ctx) to_fw_pkey_sz(dev, 128)); /* Check log_max_qp from HCA caps to set in current profile */ - if (MLX5_CAP_GEN_MAX(dev, log_max_qp) < prof->log_max_qp) { + if (prof->log_max_qp == LOG_MAX_SUPPORTED_QPS) { + prof->log_max_qp = MLX5_CAP_GEN_MAX(dev, log_max_qp); + } else if (MLX5_CAP_GEN_MAX(dev, log_max_qp) < prof->log_max_qp) { mlx5_core_warn(dev, "log_max_qp value in current profile is %d, changing it to HCA capability limit (%d)\n", prof->log_max_qp, MLX5_CAP_GEN_MAX(dev, log_max_qp)); -- 2.34.1