Skip to content

Commit

Permalink
net/mlx5: Allow 0 for total host VFs
Browse files Browse the repository at this point in the history
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: 86eec50 ("net/mlx5: Support querying max VFs from device");
Signed-off-by: Daniel Jurgens <danielj@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
  • Loading branch information
Daniel Jurgens authored and Saeed Mahameed committed Aug 7, 2023
1 parent 06c868f commit 2dc2b39
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/ethernet/mellanox/mlx5/core/sriov.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2dc2b39

Please sign in to comment.