]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net/mlx5: qos: Maintain rate group vport members in a list
authorCosmin Ratiu <cratiu@nvidia.com>
Tue, 8 Oct 2024 18:32:13 +0000 (21:32 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 10 Oct 2024 11:11:59 +0000 (13:11 +0200)
commitd3a3b0765e18d78117cbf7b4cd61cd4a6ab2b5e5
treeba6536136865dd694b1b1352b8138f83102a6e83
parent8746eeb7f80803009e2e137b8a6667820ea41c18
net/mlx5: qos: Maintain rate group vport members in a list

Previously, finding group members was done by iterating over all vports
of an eswitch and comparing their group with the required one, but that
approach will break down when a group can contain vports from multiple
eswitches.

Solve that by maintaining a list of vport members.
Instead of iterating over esw vports, loop over the members list.
Use this opportunity to provide two new functions to allocate and free a
group, so that the number of state transitions is smaller. This will
also be used in a future patch.

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