]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Nov 2020 12:27:18 +0000 (13:27 +0100)
commitba0046dc414d64fff9bd5d74a0641cd25b214a2a
tree95c52a03563a46d6bdb46f80fb823158aef517ab
parent88c2cfa3f78120bc755e538ffa8b456fc2ecf874
net/mlx5: Disable QoS when min_rates on all VFs are zero

[ Upstream commit 470b74758260e4abc2508cf1614573c00a00465c ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c