]> 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:38:51 +0000 (13:38 +0100)
commitb3f20de9e26e6ae94cee1391bab7da7db36e1d00
treee65788fb6de4fe4e93752c14dde7ba099955ab4d
parentf364bc9d6c3eee7e0937879d70d0b6b6e36d5321
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