get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/135743/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 135743,
    "url": "http://patches.dpdk.org/api/patches/135743/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240105141120.384681-3-qi.z.zhang@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20240105141120.384681-3-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240105141120.384681-3-qi.z.zhang@intel.com",
    "date": "2024-01-05T14:11:19",
    "name": "[v2,2/3] net/ice: refactor tm config data structure",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "158592e4a9049a7c86941bb652e5ab6ba484518d",
    "submitter": {
        "id": 504,
        "url": "http://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20240105141120.384681-3-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 30730,
            "url": "http://patches.dpdk.org/api/series/30730/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=30730",
            "date": "2024-01-05T14:11:17",
            "name": "net/ice: simplified to 3 layer Tx scheduler",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/30730/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/135743/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/135743/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 8ACA443837;\n\tFri,  5 Jan 2024 06:43:59 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 1B52D40649;\n\tFri,  5 Jan 2024 06:43:52 +0100 (CET)",
            "from mgamail.intel.com (mgamail.intel.com [134.134.136.65])\n by mails.dpdk.org (Postfix) with ESMTP id 2A5BF40633\n for <dev@dpdk.org>; Fri,  5 Jan 2024 06:43:50 +0100 (CET)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 04 Jan 2024 21:43:49 -0800",
            "from dpdk-qzhan15-test02.sh.intel.com ([10.67.119.16])\n by fmsmga008.fm.intel.com with ESMTP; 04 Jan 2024 21:43:47 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1704433430; x=1735969430;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=aABu8DOWc4EEq8RHO/oF/XvREcI3Xt4fO1M5brV4CVE=;\n b=f6Jp4vw1iE8kv8NZ/7pWVuEWAcUYr0tPh3K8ineb8ky29TlXUwyluIlI\n gUThWMbxPC6Klg1EqXY2DgPUxyc/ZhVDBP6iX5Mnnop8cclxhwQCjrVM5\n Itl5STxZ8h3zXCP5QsoewDwNVBwoLPanmVc+s1XRd3ON8NSHmGj55F/ZM\n eswWRxtkIwU5Y6FAoCqBFIiMeZgMqRot2h73zcYYXpapTEOYEAbkjt1LG\n joU3nfCmKLI7CfOzAjlaZJ5NOzhBpfW1gk9UnuAas97oKPXxvA+LYFHoA\n aWbWASo281RbvKJmg4whHsYtyFbNEh0IGDa2TfAtOaY2GGTlf1qf1BEqd Q==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10943\"; a=\"401221770\"",
            "E=Sophos;i=\"6.04,332,1695711600\"; d=\"scan'208\";a=\"401221770\"",
            "E=McAfee;i=\"6600,9927,10943\"; a=\"846478388\"",
            "E=Sophos;i=\"6.04,332,1695711600\"; d=\"scan'208\";a=\"846478388\""
        ],
        "X-ExtLoop1": "1",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "qiming.yang@intel.com,\n\twenjun1.wu@intel.com",
        "Cc": "dev@dpdk.org,\n\tQi Zhang <qi.z.zhang@intel.com>",
        "Subject": "[PATCH v2 2/3] net/ice: refactor tm config data structure",
        "Date": "Fri,  5 Jan 2024 09:11:19 -0500",
        "Message-Id": "<20240105141120.384681-3-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20240105141120.384681-1-qi.z.zhang@intel.com>",
        "References": "<20240105135906.383394-1-qi.z.zhang@intel.com>\n <20240105141120.384681-1-qi.z.zhang@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Simplified struct ice_tm_conf by removing per level node list.\n\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n drivers/net/ice/ice_ethdev.h |   5 +-\n drivers/net/ice/ice_tm.c     | 210 +++++++++++++++--------------------\n 2 files changed, 88 insertions(+), 127 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h\nindex ae22c29ffc..008a7a23b9 100644\n--- a/drivers/net/ice/ice_ethdev.h\n+++ b/drivers/net/ice/ice_ethdev.h\n@@ -472,6 +472,7 @@ struct ice_tm_node {\n \tuint32_t id;\n \tuint32_t priority;\n \tuint32_t weight;\n+\tuint32_t level;\n \tuint32_t reference_count;\n \tstruct ice_tm_node *parent;\n \tstruct ice_tm_node **children;\n@@ -492,10 +493,6 @@ enum ice_tm_node_type {\n struct ice_tm_conf {\n \tstruct ice_shaper_profile_list shaper_profile_list;\n \tstruct ice_tm_node *root; /* root node - port */\n-\tstruct ice_tm_node_list qgroup_list; /* node list for all the queue groups */\n-\tstruct ice_tm_node_list queue_list; /* node list for all the queues */\n-\tuint32_t nb_qgroup_node;\n-\tuint32_t nb_queue_node;\n \tbool committed;\n \tbool clear_on_fail;\n };\ndiff --git a/drivers/net/ice/ice_tm.c b/drivers/net/ice/ice_tm.c\nindex 7ae68c683b..7c662f8a85 100644\n--- a/drivers/net/ice/ice_tm.c\n+++ b/drivers/net/ice/ice_tm.c\n@@ -43,66 +43,30 @@ ice_tm_conf_init(struct rte_eth_dev *dev)\n \t/* initialize node configuration */\n \tTAILQ_INIT(&pf->tm_conf.shaper_profile_list);\n \tpf->tm_conf.root = NULL;\n-\tTAILQ_INIT(&pf->tm_conf.qgroup_list);\n-\tTAILQ_INIT(&pf->tm_conf.queue_list);\n-\tpf->tm_conf.nb_qgroup_node = 0;\n-\tpf->tm_conf.nb_queue_node = 0;\n \tpf->tm_conf.committed = false;\n \tpf->tm_conf.clear_on_fail = false;\n }\n \n-void\n-ice_tm_conf_uninit(struct rte_eth_dev *dev)\n+static void free_node(struct ice_tm_node *root)\n {\n-\tstruct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n-\tstruct ice_tm_node *tm_node;\n+\tuint32_t i;\n \n-\t/* clear node configuration */\n-\twhile ((tm_node = TAILQ_FIRST(&pf->tm_conf.queue_list))) {\n-\t\tTAILQ_REMOVE(&pf->tm_conf.queue_list, tm_node, node);\n-\t\trte_free(tm_node);\n-\t}\n-\tpf->tm_conf.nb_queue_node = 0;\n-\twhile ((tm_node = TAILQ_FIRST(&pf->tm_conf.qgroup_list))) {\n-\t\tTAILQ_REMOVE(&pf->tm_conf.qgroup_list, tm_node, node);\n-\t\trte_free(tm_node);\n-\t}\n-\tpf->tm_conf.nb_qgroup_node = 0;\n-\tif (pf->tm_conf.root) {\n-\t\trte_free(pf->tm_conf.root);\n-\t\tpf->tm_conf.root = NULL;\n-\t}\n+\tif (root == NULL)\n+\t\treturn;\n+\n+\tfor (i = 0; i < root->reference_count; i++)\n+\t\tfree_node(root->children[i]);\n+\n+\trte_free(root);\n }\n \n-static inline struct ice_tm_node *\n-ice_tm_node_search(struct rte_eth_dev *dev,\n-\t\t    uint32_t node_id, enum ice_tm_node_type *node_type)\n+void\n+ice_tm_conf_uninit(struct rte_eth_dev *dev)\n {\n \tstruct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n-\tstruct ice_tm_node_list *qgroup_list = &pf->tm_conf.qgroup_list;\n-\tstruct ice_tm_node_list *queue_list = &pf->tm_conf.queue_list;\n-\tstruct ice_tm_node *tm_node;\n-\n-\tif (pf->tm_conf.root && pf->tm_conf.root->id == node_id) {\n-\t\t*node_type = ICE_TM_NODE_TYPE_PORT;\n-\t\treturn pf->tm_conf.root;\n-\t}\n \n-\tTAILQ_FOREACH(tm_node, qgroup_list, node) {\n-\t\tif (tm_node->id == node_id) {\n-\t\t\t*node_type = ICE_TM_NODE_TYPE_QGROUP;\n-\t\t\treturn tm_node;\n-\t\t}\n-\t}\n-\n-\tTAILQ_FOREACH(tm_node, queue_list, node) {\n-\t\tif (tm_node->id == node_id) {\n-\t\t\t*node_type = ICE_TM_NODE_TYPE_QUEUE;\n-\t\t\treturn tm_node;\n-\t\t}\n-\t}\n-\n-\treturn NULL;\n+\tfree_node(pf->tm_conf.root);\n+\tpf->tm_conf.root = NULL;\n }\n \n static int\n@@ -195,11 +159,29 @@ ice_node_param_check(struct ice_pf *pf, uint32_t node_id,\n \treturn 0;\n }\n \n+static struct ice_tm_node *\n+find_node(struct ice_tm_node *root, uint32_t id)\n+{\n+\tuint32_t i;\n+\n+\tif (root == NULL || root->id == id)\n+\t\treturn root;\n+\n+\tfor (i = 0; i < root->reference_count; i++) {\n+\t\tstruct ice_tm_node *node = find_node(root->children[i], id);\n+\n+\t\tif (node)\n+\t\t\treturn node;\n+\t}\n+\n+\treturn NULL;\n+}\n+\n static int\n ice_node_type_get(struct rte_eth_dev *dev, uint32_t node_id,\n \t\t   int *is_leaf, struct rte_tm_error *error)\n {\n-\tenum ice_tm_node_type node_type = ICE_TM_NODE_TYPE_MAX;\n+\tstruct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n \tstruct ice_tm_node *tm_node;\n \n \tif (!is_leaf || !error)\n@@ -212,14 +194,14 @@ ice_node_type_get(struct rte_eth_dev *dev, uint32_t node_id,\n \t}\n \n \t/* check if the node id exists */\n-\ttm_node = ice_tm_node_search(dev, node_id, &node_type);\n+\ttm_node = find_node(pf->tm_conf.root, node_id);\n \tif (!tm_node) {\n \t\terror->type = RTE_TM_ERROR_TYPE_NODE_ID;\n \t\terror->message = \"no such node\";\n \t\treturn -EINVAL;\n \t}\n \n-\tif (node_type == ICE_TM_NODE_TYPE_QUEUE)\n+\tif (tm_node->level == ICE_TM_NODE_TYPE_QUEUE)\n \t\t*is_leaf = true;\n \telse\n \t\t*is_leaf = false;\n@@ -351,8 +333,6 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,\n \t      struct rte_tm_error *error)\n {\n \tstruct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n-\tenum ice_tm_node_type node_type = ICE_TM_NODE_TYPE_MAX;\n-\tenum ice_tm_node_type parent_node_type = ICE_TM_NODE_TYPE_MAX;\n \tstruct ice_tm_shaper_profile *shaper_profile = NULL;\n \tstruct ice_tm_node *tm_node;\n \tstruct ice_tm_node *parent_node;\n@@ -367,7 +347,7 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,\n \t\treturn ret;\n \n \t/* check if the node is already existed */\n-\tif (ice_tm_node_search(dev, node_id, &node_type)) {\n+\tif (find_node(pf->tm_conf.root, node_id)) {\n \t\terror->type = RTE_TM_ERROR_TYPE_NODE_ID;\n \t\terror->message = \"node id already used\";\n \t\treturn -EINVAL;\n@@ -408,6 +388,7 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,\n \t\tif (!tm_node)\n \t\t\treturn -ENOMEM;\n \t\ttm_node->id = node_id;\n+\t\ttm_node->level = ICE_TM_NODE_TYPE_PORT;\n \t\ttm_node->parent = NULL;\n \t\ttm_node->reference_count = 0;\n \t\ttm_node->shaper_profile = shaper_profile;\n@@ -420,29 +401,28 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,\n \t}\n \n \t/* check the parent node */\n-\tparent_node = ice_tm_node_search(dev, parent_node_id,\n-\t\t\t\t\t  &parent_node_type);\n+\tparent_node = find_node(pf->tm_conf.root, parent_node_id);\n \tif (!parent_node) {\n \t\terror->type = RTE_TM_ERROR_TYPE_NODE_PARENT_NODE_ID;\n \t\terror->message = \"parent not exist\";\n \t\treturn -EINVAL;\n \t}\n-\tif (parent_node_type != ICE_TM_NODE_TYPE_PORT &&\n-\t    parent_node_type != ICE_TM_NODE_TYPE_QGROUP) {\n+\tif (parent_node->level != ICE_TM_NODE_TYPE_PORT &&\n+\t    parent_node->level != ICE_TM_NODE_TYPE_QGROUP) {\n \t\terror->type = RTE_TM_ERROR_TYPE_NODE_PARENT_NODE_ID;\n \t\terror->message = \"parent is not valid\";\n \t\treturn -EINVAL;\n \t}\n \t/* check level */\n \tif (level_id != RTE_TM_NODE_LEVEL_ID_ANY &&\n-\t    level_id != (uint32_t)parent_node_type + 1) {\n+\t    level_id != parent_node->level + 1) {\n \t\terror->type = RTE_TM_ERROR_TYPE_NODE_PARAMS;\n \t\terror->message = \"Wrong level\";\n \t\treturn -EINVAL;\n \t}\n \n \t/* check the node number */\n-\tif (parent_node_type == ICE_TM_NODE_TYPE_PORT) {\n+\tif (parent_node->level == ICE_TM_NODE_TYPE_PORT) {\n \t\t/* check the queue group number */\n \t\tif (parent_node->reference_count >= pf->dev_data->nb_tx_queues) {\n \t\t\terror->type = RTE_TM_ERROR_TYPE_NODE_ID;\n@@ -473,6 +453,7 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,\n \ttm_node->weight = weight;\n \ttm_node->reference_count = 0;\n \ttm_node->parent = parent_node;\n+\ttm_node->level = parent_node->level + 1;\n \ttm_node->shaper_profile = shaper_profile;\n \ttm_node->children = (struct ice_tm_node **)\n \t\t\trte_calloc(NULL, 256, (sizeof(struct ice_tm_node *)), 0);\n@@ -490,15 +471,6 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,\n \n \trte_memcpy(&tm_node->params, params,\n \t\t\t sizeof(struct rte_tm_node_params));\n-\tif (parent_node_type == ICE_TM_NODE_TYPE_PORT) {\n-\t\tTAILQ_INSERT_TAIL(&pf->tm_conf.qgroup_list,\n-\t\t\t\t  tm_node, node);\n-\t\tpf->tm_conf.nb_qgroup_node++;\n-\t} else {\n-\t\tTAILQ_INSERT_TAIL(&pf->tm_conf.queue_list,\n-\t\t\t\t  tm_node, node);\n-\t\tpf->tm_conf.nb_queue_node++;\n-\t}\n \ttm_node->parent->reference_count++;\n \n \treturn 0;\n@@ -509,7 +481,6 @@ ice_tm_node_delete(struct rte_eth_dev *dev, uint32_t node_id,\n \t\t struct rte_tm_error *error)\n {\n \tstruct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n-\tenum ice_tm_node_type node_type = ICE_TM_NODE_TYPE_MAX;\n \tstruct ice_tm_node *tm_node;\n \n \tif (!error)\n@@ -522,7 +493,7 @@ ice_tm_node_delete(struct rte_eth_dev *dev, uint32_t node_id,\n \t}\n \n \t/* check if the node id exists */\n-\ttm_node = ice_tm_node_search(dev, node_id, &node_type);\n+\ttm_node = find_node(pf->tm_conf.root, node_id);\n \tif (!tm_node) {\n \t\terror->type = RTE_TM_ERROR_TYPE_NODE_ID;\n \t\terror->message = \"no such node\";\n@@ -538,7 +509,7 @@ ice_tm_node_delete(struct rte_eth_dev *dev, uint32_t node_id,\n \t}\n \n \t/* root node */\n-\tif (node_type == ICE_TM_NODE_TYPE_PORT) {\n+\tif (tm_node->level == ICE_TM_NODE_TYPE_PORT) {\n \t\trte_free(tm_node);\n \t\tpf->tm_conf.root = NULL;\n \t\treturn 0;\n@@ -546,13 +517,6 @@ ice_tm_node_delete(struct rte_eth_dev *dev, uint32_t node_id,\n \n \t/* queue group or queue node */\n \ttm_node->parent->reference_count--;\n-\tif (node_type == ICE_TM_NODE_TYPE_QGROUP) {\n-\t\tTAILQ_REMOVE(&pf->tm_conf.qgroup_list, tm_node, node);\n-\t\tpf->tm_conf.nb_qgroup_node--;\n-\t} else {\n-\t\tTAILQ_REMOVE(&pf->tm_conf.queue_list, tm_node, node);\n-\t\tpf->tm_conf.nb_queue_node--;\n-\t}\n \trte_free(tm_node);\n \n \treturn 0;\n@@ -708,9 +672,9 @@ static int ice_reset_noleaf_nodes(struct rte_eth_dev *dev)\n {\n \tstruct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n \tstruct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n-\tstruct ice_tm_node_list *qgroup_list = &pf->tm_conf.qgroup_list;\n \tstruct ice_sched_node *vsi_node = ice_get_vsi_node(hw);\n-\tstruct ice_tm_node *tm_node;\n+\tstruct ice_tm_node *root = pf->tm_conf.root;\n+\tuint32_t i;\n \tint ret;\n \n \t/* reset vsi_node */\n@@ -720,8 +684,12 @@ static int ice_reset_noleaf_nodes(struct rte_eth_dev *dev)\n \t\treturn ret;\n \t}\n \n-\t/* reset queue group nodes */\n-\tTAILQ_FOREACH(tm_node, qgroup_list, node) {\n+\tif (root == NULL)\n+\t\treturn 0;\n+\n+\tfor (i = 0; i < root->reference_count; i++) {\n+\t\tstruct ice_tm_node *tm_node = root->children[i];\n+\n \t\tif (tm_node->sched_node == NULL)\n \t\t\tcontinue;\n \n@@ -774,9 +742,7 @@ int ice_do_hierarchy_commit(struct rte_eth_dev *dev,\n {\n \tstruct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n \tstruct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n-\tstruct ice_tm_node_list *qgroup_list = &pf->tm_conf.qgroup_list;\n-\tstruct ice_tm_node_list *queue_list = &pf->tm_conf.queue_list;\n-\tstruct ice_tm_node *tm_node;\n+\tstruct ice_tm_node *root;\n \tstruct ice_sched_node *vsi_node = NULL;\n \tstruct ice_sched_node *queue_node;\n \tstruct ice_tx_queue *txq;\n@@ -807,14 +773,14 @@ int ice_do_hierarchy_commit(struct rte_eth_dev *dev,\n \n \t/* config vsi node */\n \tvsi_node = ice_get_vsi_node(hw);\n-\ttm_node = pf->tm_conf.root;\n+\troot = pf->tm_conf.root;\n \n-\tret_val = ice_set_node_rate(hw, tm_node, vsi_node);\n+\tret_val = ice_set_node_rate(hw, root, vsi_node);\n \tif (ret_val) {\n \t\terror->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;\n \t\tPMD_DRV_LOG(ERR,\n \t\t\t    \"configure vsi node %u bandwidth failed\",\n-\t\t\t    tm_node->id);\n+\t\t\t    root->id);\n \t\tgoto add_leaf;\n \t}\n \n@@ -825,13 +791,27 @@ int ice_do_hierarchy_commit(struct rte_eth_dev *dev,\n \tidx_vsi_child = 0;\n \tidx_qg = 0;\n \n-\tTAILQ_FOREACH(tm_node, qgroup_list, node) {\n+\tif (root == NULL)\n+\t\tgoto commit;\n+\n+\tfor (i = 0; i < root->reference_count; i++) {\n+\t\tstruct ice_tm_node *tm_node = root->children[i];\n \t\tstruct ice_tm_node *tm_child_node;\n \t\tstruct ice_sched_node *qgroup_sched_node =\n \t\t\tvsi_node->children[idx_vsi_child]->children[idx_qg];\n+\t\tuint32_t j;\n \n-\t\tfor (i = 0; i < tm_node->reference_count; i++) {\n-\t\t\ttm_child_node = tm_node->children[i];\n+\t\tret_val = ice_cfg_hw_node(hw, tm_node, qgroup_sched_node);\n+\t\tif (ret_val) {\n+\t\t\terror->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;\n+\t\t\tPMD_DRV_LOG(ERR,\n+\t\t\t\t    \"configure queue group node %u failed\",\n+\t\t\t\t    tm_node->id);\n+\t\t\tgoto reset_leaf;\n+\t\t}\n+\n+\t\tfor (j = 0; j < tm_node->reference_count; j++) {\n+\t\t\ttm_child_node = tm_node->children[j];\n \t\t\tqid = tm_child_node->id;\n \t\t\tret_val = ice_tx_queue_start(dev, qid);\n \t\t\tif (ret_val) {\n@@ -847,25 +827,25 @@ int ice_do_hierarchy_commit(struct rte_eth_dev *dev,\n \t\t\t\tPMD_DRV_LOG(ERR, \"get queue %u node failed\", qid);\n \t\t\t\tgoto reset_leaf;\n \t\t\t}\n-\t\t\tif (queue_node->info.parent_teid == qgroup_sched_node->info.node_teid)\n-\t\t\t\tcontinue;\n-\t\t\tret_val = ice_move_recfg_lan_txq(dev, queue_node, qgroup_sched_node, qid);\n+\t\t\tif (queue_node->info.parent_teid != qgroup_sched_node->info.node_teid) {\n+\t\t\t\tret_val = ice_move_recfg_lan_txq(dev, queue_node,\n+\t\t\t\t\t\t\t\t qgroup_sched_node, qid);\n+\t\t\t\tif (ret_val) {\n+\t\t\t\t\terror->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;\n+\t\t\t\t\tPMD_DRV_LOG(ERR, \"move queue %u failed\", qid);\n+\t\t\t\t\tgoto reset_leaf;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tret_val = ice_cfg_hw_node(hw, tm_child_node, queue_node);\n \t\t\tif (ret_val) {\n \t\t\t\terror->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;\n-\t\t\t\tPMD_DRV_LOG(ERR, \"move queue %u failed\", qid);\n+\t\t\t\tPMD_DRV_LOG(ERR,\n+\t\t\t\t\t    \"configure queue group node %u failed\",\n+\t\t\t\t\t    tm_node->id);\n \t\t\t\tgoto reset_leaf;\n \t\t\t}\n \t\t}\n \n-\t\tret_val = ice_cfg_hw_node(hw, tm_node, qgroup_sched_node);\n-\t\tif (ret_val) {\n-\t\t\terror->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;\n-\t\t\tPMD_DRV_LOG(ERR,\n-\t\t\t\t    \"configure queue group node %u failed\",\n-\t\t\t\t    tm_node->id);\n-\t\t\tgoto reset_leaf;\n-\t\t}\n-\n \t\tidx_qg++;\n \t\tif (idx_qg >= nb_qg) {\n \t\t\tidx_qg = 0;\n@@ -878,23 +858,7 @@ int ice_do_hierarchy_commit(struct rte_eth_dev *dev,\n \t\t}\n \t}\n \n-\t/* config queue nodes */\n-\tTAILQ_FOREACH(tm_node, queue_list, node) {\n-\t\tqid = tm_node->id;\n-\t\ttxq = dev->data->tx_queues[qid];\n-\t\tq_teid = txq->q_teid;\n-\t\tqueue_node = ice_sched_get_node(hw->port_info, q_teid);\n-\n-\t\tret_val = ice_cfg_hw_node(hw, tm_node, queue_node);\n-\t\tif (ret_val) {\n-\t\t\terror->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;\n-\t\t\tPMD_DRV_LOG(ERR,\n-\t\t\t\t    \"configure queue group node %u failed\",\n-\t\t\t\t    tm_node->id);\n-\t\t\tgoto reset_leaf;\n-\t\t}\n-\t}\n-\n+commit:\n \tpf->tm_conf.committed = true;\n \tpf->tm_conf.clear_on_fail = clear_on_fail;\n \n",
    "prefixes": [
        "v2",
        "2/3"
    ]
}