Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4447286pxb; Tue, 18 Jan 2022 20:07:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxA1IDqUno5whLvtemjooWly6WRZJdwHRciOSj50nluU3IWB+me+uuhJzzoeVbnHLOYpq9 X-Received: by 2002:a63:385e:: with SMTP id h30mr15186043pgn.16.1642565268678; Tue, 18 Jan 2022 20:07:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642565268; cv=none; d=google.com; s=arc-20160816; b=PnWDocmyYM+GNqPcEUNqJf8QWGfVQHB8iJrDkmGl+vFpoW0u4y5cuG/UzMoaAMgGUe IqMiWl5NGHN8xC59mOW/WAmgwXaeoxoXysAk8vhyx8BaoDXBKBTMYPEK0+u+C/84F8Sy xXFAZx83rJFTszQYbjy94jTM3hg5Pt635ZteDdLbc67nNBAP6K9fYrXOx6Br6tnPdJgU nSELxJeShBTnPfl28wxB8Neu3bLJDm5W10UgKJQeJYYtUYGJ7UEcayotGeKVBXxsBp9B mycpPfLVJse0hGKdAidDo6sZdrDk12bWCaTD9ydxRHT5+vaiRmmnQPaR8kkRDFFw+vYm dxIg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zzL1vYlnbAZfxRuZqHZlaWxvT9HGYhEtF+COaZ4BaQU=; b=iWrRhKN10Mf5ZUkgmd7FPYHe63vuIxqC+Dlpn9QSDPXAZ9hdox+W1sg/nAjZNO4dPq nnoTFAPq5D3U+fCF1kEN0O7EXPc4llamoOJ3fAVNrThCFV0lG9oYgxnA++lI4VYpdrDM 5EeInDCifkEhL0iuT9jKVCHjvr2qR+gaWmsLvHi8+rdmIDEo7ye04guaFnecm7EZGHIO zumcgWED19YRcn7RxmRaWlhW8UGhspO1ok3U7Jbsi3oZHd0/G/s/oubdxDNjxRnEdloh XOs5Seti33cCzenZ1MBYRQZkd24DghraQb8BYXG5qEndOe5r3786nxd6cw3jbZxzYK// BKLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EMvQiPZa; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 23si19004124pgy.671.2022.01.18.20.07.24; Tue, 18 Jan 2022 20:07:48 -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=@kernel.org header.s=k20201202 header.b=EMvQiPZa; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345313AbiARCtI (ORCPT + 99 others); Mon, 17 Jan 2022 21:49:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345831AbiARCcF (ORCPT ); Mon, 17 Jan 2022 21:32:05 -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 1BEEDC061774; Mon, 17 Jan 2022 18:31:26 -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 CA0ECB81235; Tue, 18 Jan 2022 02:31:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62211C36AEF; Tue, 18 Jan 2022 02:31:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642473083; bh=1yXJMUXEkxTPzr5/L/0e1NWZ8NvwKPJ/QiqyCsCia7E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EMvQiPZami7/M15Yh6gyanOIAgYt/o4HqOhOy/xnYTUWyHJdOGw1bpaC84SEXaY9f erCUj3av5z9Ne+L5thvhaHGmSoh+66zZVfWzJFXrE2wovL6og6QSL18Egn1C2ip5gO ZxIkBGVPzVdDQohj8OjrDBKXLXLQutOdS0gDRmDCoXbSE8fi2+yFfhFZja6g7MMJVy Yr4sVgGBs4TVHcl1+29xJAWmezeOo0Tv1dfIFmEDJ7suQ+TsmuWKdsv+BIxUHDWKU6 CYqBrKNgBdgN6WyxFUy472xisQwY+timzuuEPt1LeB9IR5yUZ5DajSMiXd6bi8XPGY JjIcPBM8XpPCQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Maher Sanalla , Maor Gottlieb , Saeed Mahameed , Sasha Levin , davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org Subject: [PATCH AUTOSEL 5.16 209/217] net/mlx5: Update log_max_qp value to FW max capability Date: Mon, 17 Jan 2022 21:19:32 -0500 Message-Id: <20220118021940.1942199-209-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118021940.1942199-1-sashal@kernel.org> References: <20220118021940.1942199-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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