]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net/mlx5: Add support for setting parent of nodes
authorCarolina Jubran <cjubran@nvidia.com>
Mon, 10 Mar 2025 21:26:56 +0000 (23:26 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 18 Mar 2025 09:36:55 +0000 (10:36 +0100)
commit9c7bbf4c3304f139faad4b753241963f875b4195
treed7482573d9917378e6532cd54cd8b087f98c5bf6
parentf88c349c75e3784a3f5463f5b403ff28dd823782
net/mlx5: Add support for setting parent of nodes

Introduce `mlx5_esw_devlink_rate_node_parent_set()` to allow assigning
a parent to scheduling nodes.
Implement `mlx5_esw_qos_node_update_parent()` and
`mlx5_esw_qos_node_validate_set_parent()` to enforce constraints on
node reassignment.

Don't allow reassignment of nodes with active rate objects.

Update `esw_qos_node_set_parent()` to handle cases where
the parent is NULL. A NULL parent indicates that the scheduling element
is attached to the root scheduling element, and since only rate nodes
can be connected to the root, this update is now necessary.

Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/1741642016-44918-5-git-send-email-tariqt@nvidia.com
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/mellanox/mlx5/core/devlink.c
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.h