aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorCarolina Jubran <cjubran@nvidia.com>2024-10-16 20:36:06 +0300
committerPaolo Abeni <pabeni@redhat.com>2024-10-21 13:26:16 +0200
commit24e54e870d11db3b5a52f8bb5729c55989e44ef5 (patch)
tree046ad80be4b4e7084b72c37145fdaa386b873857
parentnet/mlx5: Add parent group support in rate group structure (diff)
downloadwireguard-linux-24e54e870d11db3b5a52f8bb5729c55989e44ef5.tar.xz
wireguard-linux-24e54e870d11db3b5a52f8bb5729c55989e44ef5.zip
net/mlx5: Restrict domain list insertion to root TSAR ancestors
Update the logic for adding rate groups to the E-Switch domain list, ensuring only groups with the root Transmit Scheduling Arbiter as their parent are included. Signed-off-by: Carolina Jubran <cjubran@nvidia.com> Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Reviewed-by: Daniel Machon <daniel.machon@microchip.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c
index f2a0d59fa5bb..dd6fe729f456 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c
@@ -511,6 +511,7 @@ __esw_qos_alloc_rate_group(struct mlx5_eswitch *esw, u32 tsar_ix, enum sched_nod
struct mlx5_esw_rate_group *parent)
{
struct mlx5_esw_rate_group *group;
+ struct list_head *parent_list;
group = kzalloc(sizeof(*group), GFP_KERNEL);
if (!group)
@@ -521,7 +522,9 @@ __esw_qos_alloc_rate_group(struct mlx5_eswitch *esw, u32 tsar_ix, enum sched_nod
group->type = type;
group->parent = parent;
INIT_LIST_HEAD(&group->members);
- list_add_tail(&group->parent_entry, &esw->qos.domain->groups);
+ parent_list = parent ? &parent->members : &esw->qos.domain->groups;
+ list_add_tail(&group->parent_entry, parent_list);
+
return group;
}