From: Daniel Jurgens Date: Mon, 10 Jul 2023 21:28:10 +0000 (+0300) Subject: net/mlx5: Allow 0 for total host VFs X-Git-Tag: v6.6.7~2215^2~20^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2dc2b3922d3c0f52d3a792d15dcacfbc4cc76b8f;p=platform%2Fkernel%2Flinux-starfive.git net/mlx5: Allow 0 for total host VFs 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 --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sriov.c b/drivers/net/ethernet/mellanox/mlx5/core/sriov.c index 4e42a3b..a2fc937 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sriov.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sriov.c @@ -285,8 +285,7 @@ static u16 mlx5_get_max_vfs(struct mlx5_core_dev *dev) 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: