]> www.infradead.org Git - users/dwmw2/linux.git/commit
net/mlx5: qos: Always create group0
authorCosmin Ratiu <cratiu@nvidia.com>
Tue, 8 Oct 2024 18:32:14 +0000 (21:32 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 10 Oct 2024 11:11:59 +0000 (13:11 +0200)
commita87a561b802a45d37bc34e5a8e4f57a213ea713f
treee229edf2617555008f781fac2ba6e26ea7848261
parentd3a3b0765e18d78117cbf7b4cd61cd4a6ab2b5e5
net/mlx5: qos: Always create group0

All vports not explicitly members of a group with QoS enabled are part
of the internal esw group0, except when the hw reports that groups
aren't supported (log_esw_max_sched_depth == 0). This creates corner
cases in the code, which has to make sure that this case is supported.
Additionally, the groups are about to be moved out of eswitches, and
group0 being NULL creates additional complications there.

This patch makes sure to always create group0, even if max sched depth
is 0. In that case, a software-only group0 is created referencing the
root TSAR. Vports can point to this group when their QoS is enabled and
they'll be attached to the root TSAR directly. This eliminates corner
cases in the code by offering the guarantee that if qos is enabled,
vport->qos.group is non-NULL.

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