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 C1B269446 for ; Sun, 13 Aug 2023 21:47:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04310C433C7; Sun, 13 Aug 2023 21:47:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1691963274; bh=fgXNGAQTYlYSjdQdXDBa5ODIxnNhcUvDqKXl2asq4bo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NHqOWrvI2QCaOEIso1JctbVJttAOaRh4jIaiqlgIvT9evr8RVrRMYvuVwsHUNFVFh JhVB0/3c/q6MbOBSClIEeS/KXWBw6FJCSRtL34+qHsscarP0jAzpFuVCSKo+awSD1G CsFBzbcQaWQ0VF3Ci4VcdWj/69sm3aXYQbLo50p0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Daniel Jurgens , Saeed Mahameed Subject: [PATCH 5.4 26/39] net/mlx5: Allow 0 for total host VFs Date: Sun, 13 Aug 2023 23:20:17 +0200 Message-ID: <20230813211705.707135143@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230813211704.796906808@linuxfoundation.org> References: <20230813211704.796906808@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 @@ -211,8 +211,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: