]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Don't treat small ceil values as unlimited in HTB offload
authorMaxim Mikityanskiy <maximmi@nvidia.com>
Tue, 18 Jan 2022 11:31:54 +0000 (13:31 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 2 Feb 2022 04:59:42 +0000 (20:59 -0800)
commit1889099a4e729b0ba84fc4ddb227d93be392bc09
treeea4194f92065a1cd9bea52f6568f1f53fa466ac9
parent801c154342ad7b6c7f01ffebc33d691f77ec2cb1
net/mlx5e: Don't treat small ceil values as unlimited in HTB offload

The hardware spec defines max_average_bw == 0 as "unlimited bandwidth".
max_average_bw is calculated as `ceil / BYTES_IN_MBIT`, which can become
0 when ceil is small, leading to an undesired effect of having no
bandwidth limit.

This commit fixes it by rounding up small values of ceil to 1 Mbit/s.

Fixes: e3c0fa63bfb7 ("net/mlx5e: Support HTB offload")
Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/qos.c