]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5: qos: Refactor and document bw_share calculation
authorCosmin Ratiu <cratiu@nvidia.com>
Tue, 8 Oct 2024 18:32:12 +0000 (21:32 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 10 Oct 2024 11:11:59 +0000 (13:11 +0200)
commit8746eeb7f80803009e2e137b8a6667820ea41c18
tree99c2d141c60b0121c2e233d6520fe3bd9f7eea8e
parent16efefde21f50b15ccc01e1993d578d34b201611
net/mlx5: qos: Refactor and document bw_share calculation

The previous function (esw_qos_calculate_group_min_rate_divider) had two
completely different modes of execution, depending on the 'group_level'
parameter. Split it into two separate functions:
- esw_qos_calculate_min_rate_divider - computes min across groups.
- esw_qos_calculate_group_min_rate_divider - computes min in a group.

Fold the divider calculation into the corresponding normalize functions
to avoid having the caller compute the corresponding divider.
Also rename the normalize functions to better indicate what level
they're operating on.
Finally, document everything so that this topic can more easily be
understood by future maintainers.

Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h