net/mlx5: Disable QoS when min_rates on all VFs are zero
authorVladyslav Tarasiuk <vladyslavt@nvidia.com>
Wed, 21 Oct 2020 08:05:41 +0000 (11:05 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 17 Nov 2020 19:50:53 +0000 (11:50 -0800)
commit470b74758260e4abc2508cf1614573c00a00465c
tree73b3d444f7bfffbccee2c840d34bcffc5614569e
parent1ce5fc724a26e0b476e42c5d588bdb80caea003b
net/mlx5: Disable QoS when min_rates on all VFs are zero

Currently when QoS is enabled for VF and any min_rate is configured,
the driver sets bw_share value to at least 1 and doesn’t allow to set
it to 0 to make minimal rate unlimited. It means there is always a
minimal rate configured for every VF, even if user tries to remove it.

In order to make QoS disable possible, check whether all vports have
configured min_rate = 0. If this is true, set their bw_share to 0 to
disable min_rate limitations.

Fixes: c9497c98901c ("net/mlx5: Add support for setting VF min rate")
Signed-off-by: Vladyslav Tarasiuk <vladyslavt@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c