Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3697023pxb; Mon, 24 Jan 2022 15:38:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyAnnUT2gmB1LhN2BhWsqAxQ/393B4iKM2srke+U0dI96WLPbM6XJZsdR2yQfUSlJvfxE74 X-Received: by 2002:a05:6a00:8c5:b0:4bc:4c7e:7742 with SMTP id s5-20020a056a0008c500b004bc4c7e7742mr16129849pfu.18.1643067537670; Mon, 24 Jan 2022 15:38:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643067537; cv=none; d=google.com; s=arc-20160816; b=jplegmQWH++aIjN7lCARwv8JgwzyPl3CBNirXMHsR6/g3L+vthIDXhuH7gqy+lLKfE z7a84uSSo9xPvCi73Ry+k0zr0VBoJK3SCIkI1baVpVLKMEGTb/XF8ynoV58hC2xN+ToI Wra3gInGMpSleseptrNkQo4D49WzrT95iq+tSqe7/fcqrgmaN3MgtDzHH3d2fQie+DsT PuOem+LW1M3MDaQw8OQsXMaVi+xf6PTQ9mT7hFRNjjwJvAYx/7XMZS/V9cuhsA6RLVTS PFMCVG6m0vwl43kXLKPiJGUZYFeSSRLoegRCSg4YJTWDE5FrFjpQMiVkNLKw2sRtvR7v prhQ== 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=A9C7DxWi4K6+TfKS/qkULuPZHapAAD1Ep9qra6PNIns=; b=MV+gOhoisAX6RbY6187+6SSrhapz3P6MMqC+vuPChEhR5glXYesIPbJo1cVxBjcCFT cVNyRmDm38qoJlDD0jjK2oHIk9JuVFBriNmKUMx0e75GQnzMW2aSO+jSM27U7WIj/g/3 pqlpPl1mS2KZDRy3L4m5okwS+UYRmVU7RUXP6AD6CcCmrVsSdjDo9DR7IuQVIh0sO5ng K2ENBkJL0BhTqQhWYkurcxrF7nUn4lTW0b/CKDoL51N2TOI3FtUkiyaskXUZrSly4D5K 5SdLkHeuwjbXzh08EtTTH+Bsdnv8qhmBJJv4AsCEvn2KQ5WHSz1M9uqrI0r2QB4JzRlD D56A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="WG6/3vWe"; 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 k26si17993890pgm.320.2022.01.24.15.38.46; Mon, 24 Jan 2022 15:38:57 -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="WG6/3vWe"; 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 S1851360AbiAXXcd (ORCPT + 99 others); Mon, 24 Jan 2022 18:32:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1579204AbiAXWFM (ORCPT ); Mon, 24 Jan 2022 17:05:12 -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 7267BC045902; Mon, 24 Jan 2022 12:42:18 -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 E9D8CB8122A; Mon, 24 Jan 2022 20:42:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24F2DC340E7; Mon, 24 Jan 2022 20:42:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056935; bh=TvWm8VA0FL0gbTrcAIrjiYnHCBn+7z1eGZmV+NVBhVA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WG6/3vWeJOS83lXSK6BaFWTxzhjO3gCWfBa3kFz5K/feAHL+PBhHEZzqYsMATBp2d yQnLqKxHBxYWTMYR2HvMba4KsiShSuu8AN52q+tBJXgLRH6JPCQPS56J7pZCxlHV1k 9pOcCRWSn2y6KswoZbaK/KE16QmJWtIHKyqqZyWQ= 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.15 615/846] net/mlx5: Update log_max_qp value to FW max capability Date: Mon, 24 Jan 2022 19:42:12 +0100 Message-Id: <20220124184122.258580071@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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 92b01858d7f3e..29b7297a836a5 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -97,6 +97,8 @@ enum { MLX5_ATOMIC_REQ_MODE_HOST_ENDIANNESS = 0x1, }; +#define LOG_MAX_SUPPORTED_QPS 0xff + static struct mlx5_profile profile[] = { [0] = { .mask = 0, @@ -108,7 +110,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 @@ -513,7 +515,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