net/mlx5: Reset bw_share field when changing a node's parent
authorCarolina Jubran <cjubran@nvidia.com>
Thu, 10 Jul 2025 13:53:42 +0000 (16:53 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 11 Jul 2025 14:26:44 +0000 (07:26 -0700)
When changing a node's parent, its scheduling element is destroyed and
re-created with bw_share 0. However, the node's bw_share field was not
updated accordingly.

Set the node's bw_share to 0 after re-creation to keep the software
state in sync with the firmware configuration.

Fixes: 9c7bbf4c3304 ("net/mlx5: Add support for setting parent of nodes")
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>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/1752155624-24095-2-git-send-email-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c

index b6ae384396b335c720158414b83d6cd179e5c324..ad9f6fca9b6a203095323b49d49a18121a65049f 100644 (file)
@@ -1076,6 +1076,7 @@ static int esw_qos_vports_node_update_parent(struct mlx5_esw_sched_node *node,
                return err;
        }
        esw_qos_node_set_parent(node, parent);
+       node->bw_share = 0;
 
        return 0;
 }