]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net/mlx5: Improve QoS error messages with actual depth values
authorCarolina Jubran <cjubran@nvidia.com>
Sun, 28 Sep 2025 21:25:19 +0000 (00:25 +0300)
committerJakub Kicinski <kuba@kernel.org>
Wed, 1 Oct 2025 00:21:14 +0000 (17:21 -0700)
Enhance error messages in MLX5 QoS scheduling depth validation by
including the actual values that caused the validation to fail.

Suggested-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/1759094723-843774-4-git-send-email-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c

index 5f2d6c35f1ad5962bf725f3318218a8826139416..56e6f54b1e2ed680b9c7d52d4b5a574462063f1e 100644 (file)
@@ -971,8 +971,9 @@ esw_qos_vport_tc_enable(struct mlx5_vport *vport, enum sched_node_type type,
                max_level = 1 << MLX5_CAP_QOS(vport_node->esw->dev,
                                              log_esw_max_sched_depth);
                if (new_level > max_level) {
-                       NL_SET_ERR_MSG_MOD(extack,
-                                          "TC arbitration on leafs is not supported beyond max scheduling depth");
+                       NL_SET_ERR_MSG_FMT_MOD(extack,
+                                              "TC arbitration on leafs is not supported beyond max depth %d",
+                                              max_level);
                        return -EOPNOTSUPP;
                }
        }
@@ -1444,8 +1445,9 @@ static int esw_qos_node_enable_tc_arbitration(struct mlx5_esw_sched_node *node,
        new_level = node->level + 1;
        max_level = 1 << MLX5_CAP_QOS(node->esw->dev, log_esw_max_sched_depth);
        if (new_level > max_level) {
-               NL_SET_ERR_MSG_MOD(extack,
-                                  "TC arbitration on nodes is not supported beyond max scheduling depth");
+               NL_SET_ERR_MSG_FMT_MOD(extack,
+                                      "TC arbitration on nodes is not supported beyond max depth %d",
+                                      max_level);
                return -EOPNOTSUPP;
        }
 
@@ -1997,8 +1999,9 @@ mlx5_esw_qos_node_validate_set_parent(struct mlx5_esw_sched_node *node,
 
        max_level = 1 << MLX5_CAP_QOS(node->esw->dev, log_esw_max_sched_depth);
        if (new_level > max_level) {
-               NL_SET_ERR_MSG_MOD(extack,
-                                  "Node hierarchy depth exceeds the maximum supported level");
+               NL_SET_ERR_MSG_FMT_MOD(extack,
+                                      "Node hierarchy depth %d exceeds the maximum supported level %d",
+                                      new_level, max_level);
                return -EOPNOTSUPP;
        }