get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 110049,
    "url": "http://patches.dpdk.org/api/patches/110049/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220422005746.2300736-6-wenjun1.wu@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": "<20220422005746.2300736-6-wenjun1.wu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220422005746.2300736-6-wenjun1.wu@intel.com",
    "date": "2022-04-22T00:57:42",
    "name": "[v7,5/9] net/ice: support queue group bandwidth limit",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2b8f763195a26384ac1e7bc0a2cbd84447d55234",
    "submitter": {
        "id": 2083,
        "url": "http://patches.dpdk.org/api/people/2083/?format=api",
        "name": "Wenjun Wu",
        "email": "wenjun1.wu@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/20220422005746.2300736-6-wenjun1.wu@intel.com/mbox/",
    "series": [
        {
            "id": 22604,
            "url": "http://patches.dpdk.org/api/series/22604/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=22604",
            "date": "2022-04-22T00:57:37",
            "name": "Enable ETS-based TX QoS on PF",
            "version": 7,
            "mbox": "http://patches.dpdk.org/series/22604/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/110049/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/110049/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 6D675A0093;\n\tFri, 22 Apr 2022 03:20:10 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 9B9014280E;\n\tFri, 22 Apr 2022 03:19:42 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by mails.dpdk.org (Postfix) with ESMTP id E966A427FE\n for <dev@dpdk.org>; Fri, 22 Apr 2022 03:19:39 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 21 Apr 2022 18:19:39 -0700",
            "from npg-wuwenjun-dpdk-01.sh.intel.com ([10.67.110.181])\n by orsmga002.jf.intel.com with ESMTP; 21 Apr 2022 18:19:37 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1650590380; x=1682126380;\n h=from:to:subject:date:message-id:in-reply-to:references:\n mime-version:content-transfer-encoding;\n bh=fUsNcJl8WFWNJQWQdXMP2EjQ1E856UXHWWOLqveDBjE=;\n b=WVzYemjsT1nVSMmnrX957sxRN32u8hRU38pomeuiiBS5cjgl24WhTFWA\n mdr1/XETQW0lU+mWyaF19lYsMRRhZlgOLXXXttDH30k52S7dh4VZgooEF\n H3cqmSplwl97hkhj5+IM50tEsI8ExQwTE8O7/fKoijieA4jjcjxJbTLbb\n TEV6/HezXu75e+2D5toFSK6Nlt8TedQOgFdiOcwJF1gZMnQ/Bpwf+W4xT\n fBmuG1LRVH0EGX/QtjF0VZniRJOxfP2EpxZ2TL0sLoHthxusCQVijdnyE\n NpD3bsBZ4D3VEklca/Tt21fuHC49EXiuSXky56zP+Aoo8c7z+N5vFgWi3 g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6400,9594,10324\"; a=\"350972724\"",
            "E=Sophos;i=\"5.90,280,1643702400\"; d=\"scan'208\";a=\"350972724\"",
            "E=Sophos;i=\"5.90,280,1643702400\"; d=\"scan'208\";a=\"533816346\""
        ],
        "X-ExtLoop1": "1",
        "From": "Wenjun Wu <wenjun1.wu@intel.com>",
        "To": "dev@dpdk.org,\n\tqiming.yang@intel.com,\n\tqi.z.zhang@intel.com",
        "Subject": "[PATCH v7 5/9] net/ice: support queue group bandwidth limit",
        "Date": "Fri, 22 Apr 2022 08:57:42 +0800",
        "Message-Id": "<20220422005746.2300736-6-wenjun1.wu@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220422005746.2300736-1-wenjun1.wu@intel.com>",
        "References": "<20220329014813.1092054-1-wenjun1.wu@intel.com>\n <20220422005746.2300736-1-wenjun1.wu@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": "To set up the exact queue group, we need to reconfigure topology by\ndelete and then recreate queue nodes.\n\nThis patch adds queue group configuration support and queue group\nbandwidth limit support.\n\nSigned-off-by: Wenjun Wu <wenjun1.wu@intel.com>\n---\n drivers/net/ice/ice_ethdev.h |   9 +-\n drivers/net/ice/ice_tm.c     | 239 ++++++++++++++++++++++++++++++++---\n 2 files changed, 232 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h\nindex 0841e1866c..6ddbcc9972 100644\n--- a/drivers/net/ice/ice_ethdev.h\n+++ b/drivers/net/ice/ice_ethdev.h\n@@ -474,6 +474,7 @@ struct ice_tm_node {\n \tuint32_t weight;\n \tuint32_t reference_count;\n \tstruct ice_tm_node *parent;\n+\tstruct ice_tm_node **children;\n \tstruct ice_tm_shaper_profile *shaper_profile;\n \tstruct rte_tm_node_params params;\n };\n@@ -482,6 +483,8 @@ struct ice_tm_node {\n enum ice_tm_node_type {\n \tICE_TM_NODE_TYPE_PORT,\n \tICE_TM_NODE_TYPE_TC,\n+\tICE_TM_NODE_TYPE_VSI,\n+\tICE_TM_NODE_TYPE_QGROUP,\n \tICE_TM_NODE_TYPE_QUEUE,\n \tICE_TM_NODE_TYPE_MAX,\n };\n@@ -489,10 +492,14 @@ enum ice_tm_node_type {\n /* Struct to store all the Traffic Manager configuration. */\n struct ice_tm_conf {\n \tstruct ice_shaper_profile_list shaper_profile_list;\n-\tstruct ice_tm_node *root; /* root node - vf vsi */\n+\tstruct ice_tm_node *root; /* root node - port */\n \tstruct ice_tm_node_list tc_list; /* node list for all the TCs */\n+\tstruct ice_tm_node_list vsi_list; /* node list for all the VSIs */\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_tc_node;\n+\tuint32_t nb_vsi_node;\n+\tuint32_t nb_qgroup_node;\n \tuint32_t nb_queue_node;\n \tbool committed;\n };\ndiff --git a/drivers/net/ice/ice_tm.c b/drivers/net/ice/ice_tm.c\nindex 383af88981..d70d077286 100644\n--- a/drivers/net/ice/ice_tm.c\n+++ b/drivers/net/ice/ice_tm.c\n@@ -44,8 +44,12 @@ ice_tm_conf_init(struct rte_eth_dev *dev)\n \tTAILQ_INIT(&pf->tm_conf.shaper_profile_list);\n \tpf->tm_conf.root = NULL;\n \tTAILQ_INIT(&pf->tm_conf.tc_list);\n+\tTAILQ_INIT(&pf->tm_conf.vsi_list);\n+\tTAILQ_INIT(&pf->tm_conf.qgroup_list);\n \tTAILQ_INIT(&pf->tm_conf.queue_list);\n \tpf->tm_conf.nb_tc_node = 0;\n+\tpf->tm_conf.nb_vsi_node = 0;\n+\tpf->tm_conf.nb_qgroup_node = 0;\n \tpf->tm_conf.nb_queue_node = 0;\n \tpf->tm_conf.committed = false;\n }\n@@ -62,6 +66,16 @@ ice_tm_conf_uninit(struct rte_eth_dev *dev)\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+\twhile ((tm_node = TAILQ_FIRST(&pf->tm_conf.vsi_list))) {\n+\t\tTAILQ_REMOVE(&pf->tm_conf.vsi_list, tm_node, node);\n+\t\trte_free(tm_node);\n+\t}\n+\tpf->tm_conf.nb_vsi_node = 0;\n \twhile ((tm_node = TAILQ_FIRST(&pf->tm_conf.tc_list))) {\n \t\tTAILQ_REMOVE(&pf->tm_conf.tc_list, tm_node, node);\n \t\trte_free(tm_node);\n@@ -79,6 +93,8 @@ ice_tm_node_search(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 *tc_list = &pf->tm_conf.tc_list;\n+\tstruct ice_tm_node_list *vsi_list = &pf->tm_conf.vsi_list;\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@@ -94,6 +110,20 @@ ice_tm_node_search(struct rte_eth_dev *dev,\n \t\t}\n \t}\n \n+\tTAILQ_FOREACH(tm_node, vsi_list, node) {\n+\t\tif (tm_node->id == node_id) {\n+\t\t\t*node_type = ICE_TM_NODE_TYPE_VSI;\n+\t\t\treturn tm_node;\n+\t\t}\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@@ -354,6 +384,7 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,\n \tstruct ice_tm_node *tm_node;\n \tstruct ice_tm_node *parent_node;\n \tuint16_t tc_nb = 1;\n+\tuint16_t vsi_nb = 1;\n \tint ret;\n \n \tif (!params || !error)\n@@ -415,6 +446,8 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,\n \t\ttm_node->id = node_id;\n \t\ttm_node->parent = NULL;\n \t\ttm_node->reference_count = 0;\n+\t\ttm_node->children = (struct ice_tm_node **)\n+\t\t\trte_calloc(NULL, 256, (sizeof(struct ice_tm_node *)), 0);\n \t\trte_memcpy(&tm_node->params, params,\n \t\t\t\t sizeof(struct rte_tm_node_params));\n \t\tpf->tm_conf.root = tm_node;\n@@ -431,9 +464,11 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,\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_TC) {\n+\t    parent_node_type != ICE_TM_NODE_TYPE_TC &&\n+\t    parent_node_type != ICE_TM_NODE_TYPE_VSI &&\n+\t    parent_node_type != ICE_TM_NODE_TYPE_QGROUP) {\n \t\terror->type = RTE_TM_ERROR_TYPE_NODE_PARENT_NODE_ID;\n-\t\terror->message = \"parent is not root or TC\";\n+\t\terror->message = \"parent is not valid\";\n \t\treturn -EINVAL;\n \t}\n \t/* check level */\n@@ -452,6 +487,20 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,\n \t\t\terror->message = \"too many TCs\";\n \t\t\treturn -EINVAL;\n \t\t}\n+\t} else if (parent_node_type == ICE_TM_NODE_TYPE_TC) {\n+\t\t/* check the VSI number */\n+\t\tif (pf->tm_conf.nb_vsi_node >= vsi_nb) {\n+\t\t\terror->type = RTE_TM_ERROR_TYPE_NODE_ID;\n+\t\t\terror->message = \"too many VSIs\";\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t} else if (parent_node_type == ICE_TM_NODE_TYPE_VSI) {\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+\t\t\terror->message = \"too many queue groups\";\n+\t\t\treturn -EINVAL;\n+\t\t}\n \t} else {\n \t\t/* check the queue number */\n \t\tif (parent_node->reference_count >= pf->dev_data->nb_tx_queues) {\n@@ -466,7 +515,7 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,\n \t\t}\n \t}\n \n-\t/* add the TC or queue node */\n+\t/* add the TC or VSI or queue group or queue node */\n \ttm_node = rte_zmalloc(\"ice_tm_node\",\n \t\t\t      sizeof(struct ice_tm_node),\n \t\t\t      0);\n@@ -478,6 +527,10 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,\n \ttm_node->reference_count = 0;\n \ttm_node->parent = parent_node;\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+\ttm_node->parent->children[tm_node->parent->reference_count] = tm_node;\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@@ -485,10 +538,20 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,\n \t\t\t\t  tm_node, node);\n \t\ttm_node->tc = pf->tm_conf.nb_tc_node;\n \t\tpf->tm_conf.nb_tc_node++;\n+\t} else if (parent_node_type == ICE_TM_NODE_TYPE_TC) {\n+\t\tTAILQ_INSERT_TAIL(&pf->tm_conf.vsi_list,\n+\t\t\t\t  tm_node, node);\n+\t\ttm_node->tc = parent_node->tc;\n+\t\tpf->tm_conf.nb_vsi_node++;\n+\t} else if (parent_node_type == ICE_TM_NODE_TYPE_VSI) {\n+\t\tTAILQ_INSERT_TAIL(&pf->tm_conf.qgroup_list,\n+\t\t\t\t  tm_node, node);\n+\t\ttm_node->tc = parent_node->parent->tc;\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\ttm_node->tc = parent_node->tc;\n+\t\ttm_node->tc = parent_node->parent->parent->tc;\n \t\tpf->tm_conf.nb_queue_node++;\n \t}\n \ttm_node->parent->reference_count++;\n@@ -543,11 +606,17 @@ ice_tm_node_delete(struct rte_eth_dev *dev, uint32_t node_id,\n \t\treturn 0;\n \t}\n \n-\t/* TC or queue node */\n+\t/* TC or VSI or queue group or queue node */\n \ttm_node->parent->reference_count--;\n \tif (node_type == ICE_TM_NODE_TYPE_TC) {\n \t\tTAILQ_REMOVE(&pf->tm_conf.tc_list, tm_node, node);\n \t\tpf->tm_conf.nb_tc_node--;\n+\t} else if (node_type == ICE_TM_NODE_TYPE_VSI) {\n+\t\tTAILQ_REMOVE(&pf->tm_conf.vsi_list, tm_node, node);\n+\t\tpf->tm_conf.nb_vsi_node--;\n+\t} else if (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@@ -557,36 +626,176 @@ ice_tm_node_delete(struct rte_eth_dev *dev, uint32_t node_id,\n \treturn 0;\n }\n \n+static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev,\n+\t\t\t\t  struct ice_sched_node *queue_sched_node,\n+\t\t\t\t  struct ice_sched_node *dst_node,\n+\t\t\t\t  uint16_t queue_id)\n+{\n+\tstruct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct ice_aqc_move_txqs_data *buf;\n+\tstruct ice_sched_node *queue_parent_node;\n+\tuint8_t txqs_moved;\n+\tint ret = ICE_SUCCESS;\n+\tuint16_t buf_size = ice_struct_size(buf, txqs, 1);\n+\n+\tbuf = (struct ice_aqc_move_txqs_data *)ice_malloc(hw, sizeof(*buf));\n+\n+\tqueue_parent_node = queue_sched_node->parent;\n+\tbuf->src_teid = queue_parent_node->info.node_teid;\n+\tbuf->dest_teid = dst_node->info.node_teid;\n+\tbuf->txqs[0].q_teid = queue_sched_node->info.node_teid;\n+\tbuf->txqs[0].txq_id = queue_id;\n+\n+\tret = ice_aq_move_recfg_lan_txq(hw, 1, true, false, false, false, 50,\n+\t\t\t\t\tNULL, buf, buf_size, &txqs_moved, NULL);\n+\tif (ret || txqs_moved == 0) {\n+\t\tPMD_DRV_LOG(ERR, \"move lan queue %u failed\", queue_id);\n+\t\treturn ICE_ERR_PARAM;\n+\t}\n+\n+\tif (queue_parent_node->num_children > 0) {\n+\t\tqueue_parent_node->num_children--;\n+\t\tqueue_parent_node->children[queue_parent_node->num_children] = NULL;\n+\t} else {\n+\t\tPMD_DRV_LOG(ERR, \"invalid children number %d for queue %u\",\n+\t\t\t    queue_parent_node->num_children, queue_id);\n+\t\treturn ICE_ERR_PARAM;\n+\t}\n+\tdst_node->children[dst_node->num_children++] = queue_sched_node;\n+\tqueue_sched_node->parent = dst_node;\n+\tice_sched_query_elem(hw, queue_sched_node->info.node_teid, &queue_sched_node->info);\n+\n+\treturn ret;\n+}\n+\n static int ice_hierarchy_commit(struct rte_eth_dev *dev,\n \t\t\t\t int clear_on_fail,\n \t\t\t\t __rte_unused struct rte_tm_error *error)\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_sched_node *node;\n+\tstruct ice_sched_node *vsi_node;\n+\tstruct ice_sched_node *queue_node;\n \tstruct ice_tx_queue *txq;\n \tstruct ice_vsi *vsi;\n \tint ret_val = ICE_SUCCESS;\n \tuint64_t peak = 0;\n+\tuint32_t i;\n+\tuint32_t idx_vsi_child;\n+\tuint32_t idx_qg;\n+\tuint32_t nb_vsi_child;\n+\tuint32_t nb_qg;\n+\tuint32_t qid;\n+\tuint32_t q_teid;\n+\tuint32_t vsi_layer;\n+\n+\tfor (i = 0; i < dev->data->nb_tx_queues; i++) {\n+\t\tret_val = ice_tx_queue_stop(dev, i);\n+\t\tif (ret_val) {\n+\t\t\terror->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;\n+\t\t\tPMD_DRV_LOG(ERR, \"stop queue %u failed\", i);\n+\t\t\tgoto fail_clear;\n+\t\t}\n+\t}\n \n-\tTAILQ_FOREACH(tm_node, queue_list, node) {\n-\t\ttxq = dev->data->tx_queues[tm_node->id];\n-\t\tvsi = txq->vsi;\n-\t\tif (tm_node->shaper_profile)\n+\tnode = hw->port_info->root;\n+\tvsi_layer = hw->num_tx_sched_layers - ICE_VSI_LAYER_OFFSET;\n+\tfor (i = 0; i < vsi_layer; i++)\n+\t\tnode = node->children[0];\n+\tvsi_node = node;\n+\tnb_vsi_child = vsi_node->num_children;\n+\tnb_qg = vsi_node->children[0]->num_children;\n+\n+\tidx_vsi_child = 0;\n+\tidx_qg = 0;\n+\n+\tTAILQ_FOREACH(tm_node, qgroup_list, node) {\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+\n+\t\tfor (i = 0; i < tm_node->reference_count; i++) {\n+\t\t\ttm_child_node = tm_node->children[i];\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+\t\t\t\terror->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;\n+\t\t\t\tPMD_DRV_LOG(ERR, \"start queue %u failed\", qid);\n+\t\t\t\tgoto fail_clear;\n+\t\t\t}\n+\t\t\ttxq = dev->data->tx_queues[qid];\n+\t\t\tq_teid = txq->q_teid;\n+\t\t\tqueue_node = ice_sched_get_node(hw->port_info, q_teid);\n+\t\t\tif (queue_node == NULL) {\n+\t\t\t\terror->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;\n+\t\t\t\tPMD_DRV_LOG(ERR, \"get queue %u node failed\", qid);\n+\t\t\t\tgoto fail_clear;\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 (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\tgoto fail_clear;\n+\t\t\t}\n+\t\t}\n+\t\tif (tm_node->reference_count != 0 && tm_node->shaper_profile) {\n+\t\t\tuint32_t node_teid = qgroup_sched_node->info.node_teid;\n \t\t\t/* Transfer from Byte per seconds to Kbps */\n \t\t\tpeak = tm_node->shaper_profile->profile.peak.rate;\n-\n-\t\tpeak = peak / 1000 * BITS_PER_BYTE;\n-\t\tret_val = ice_cfg_q_bw_lmt(hw->port_info, vsi->idx,\n-\t\t\t\t tm_node->tc, tm_node->id, ICE_MAX_BW, (u32)peak);\n-\t\tif (ret_val) {\n+\t\t\tpeak = peak / 1000 * BITS_PER_BYTE;\n+\t\t\tret_val = ice_sched_set_node_bw_lmt_per_tc(hw->port_info,\n+\t\t\t\t\t\t\t\t   node_teid,\n+\t\t\t\t\t\t\t\t   ICE_AGG_TYPE_Q,\n+\t\t\t\t\t\t\t\t   tm_node->tc,\n+\t\t\t\t\t\t\t\t   ICE_MAX_BW,\n+\t\t\t\t\t\t\t\t   (u32)peak);\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,\n+\t\t\t\t\t    \"configure queue group %u bandwidth failed\",\n+\t\t\t\t\t    tm_node->id);\n+\t\t\t\tgoto fail_clear;\n+\t\t\t}\n+\t\t}\n+\t\tidx_qg++;\n+\t\tif (idx_qg >= nb_qg) {\n+\t\t\tidx_qg = 0;\n+\t\t\tidx_vsi_child++;\n+\t\t}\n+\t\tif (idx_vsi_child >= nb_vsi_child) {\n \t\t\terror->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;\n-\t\t\tPMD_DRV_LOG(ERR, \"configure queue %u bandwidth failed\", tm_node->id);\n+\t\t\tPMD_DRV_LOG(ERR, \"too many queues\");\n \t\t\tgoto fail_clear;\n \t\t}\n \t}\n \n+\tTAILQ_FOREACH(tm_node, queue_list, node) {\n+\t\tqid = tm_node->id;\n+\t\ttxq = dev->data->tx_queues[qid];\n+\t\tvsi = txq->vsi;\n+\t\tif (tm_node->shaper_profile) {\n+\t\t\t/* Transfer from Byte per seconds to Kbps */\n+\t\t\tpeak = tm_node->shaper_profile->profile.peak.rate;\n+\t\t\tpeak = peak / 1000 * BITS_PER_BYTE;\n+\t\t\tret_val = ice_cfg_q_bw_lmt(hw->port_info, vsi->idx,\n+\t\t\t\t\t\t   tm_node->tc, tm_node->id,\n+\t\t\t\t\t\t   ICE_MAX_BW, (u32)peak);\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,\n+\t\t\t\t\t    \"configure queue %u bandwidth failed\",\n+\t\t\t\t\t    tm_node->id);\n+\t\t\t\tgoto fail_clear;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n \treturn ret_val;\n \n fail_clear:\n",
    "prefixes": [
        "v7",
        "5/9"
    ]
}