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>
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)
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;
}