From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A74249446 for ; Sun, 13 Aug 2023 21:37:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14D65C433C8; Sun, 13 Aug 2023 21:37:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1691962678; bh=k5ugLlfZRSmCR9LajVGptlVNUxgulYTw2yzMtVVeGLU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wkYAX4KRMfCXNmXIDMCrl8hepXSM8VBGccoF/tTYEUib/UIB7kdAaatlZQxTEhO/H j5/O3TvSaeLKnnbekJDMNSVP00BudSqC1hPYwZvmh9wt9AnJwpfarK9dZpqFOhjFgY YgDFp7A0Sfy8WCM8F+xSb4AikX4Md3nSFJXu7PJ4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Daniel Jurgens , Saeed Mahameed Subject: [PATCH 6.1 116/149] net/mlx5: Allow 0 for total host VFs Date: Sun, 13 Aug 2023 23:19:21 +0200 Message-ID: <20230813211722.214973637@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230813211718.757428827@linuxfoundation.org> References: <20230813211718.757428827@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Daniel Jurgens commit 2dc2b3922d3c0f52d3a792d15dcacfbc4cc76b8f upstream. When querying eswitch functions 0 is a valid number of host VFs. After introducing ARM SRIOV falling through to getting the max value from PCI results in using the total VFs allowed on the ARM for the host. Fixes: 86eec50beaf3 ("net/mlx5: Support querying max VFs from device"); Signed-off-by: Daniel Jurgens Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/sriov.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/sriov.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sriov.c @@ -264,8 +264,7 @@ static u16 mlx5_get_max_vfs(struct mlx5_ host_total_vfs = MLX5_GET(query_esw_functions_out, out, host_params_context.host_total_vfs); kvfree(out); - if (host_total_vfs) - return host_total_vfs; + return host_total_vfs; } done: