get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 135636,
    "url": "http://patches.dpdk.org/api/patches/135636/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240102102900.3435496-1-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": "<20240102102900.3435496-1-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240102102900.3435496-1-qi.z.zhang@intel.com",
    "date": "2024-01-02T10:28:59",
    "name": "[v4,1/2] net/ice: reset Tx sched node during commit",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "af33052188663dfe1d915ecd5d9bc6cfe1788a58",
    "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/20240102102900.3435496-1-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 30688,
            "url": "http://patches.dpdk.org/api/series/30688/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=30688",
            "date": "2024-01-02T10:28:59",
            "name": "[v4,1/2] net/ice: reset Tx sched node during commit",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/30688/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/135636/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/135636/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 D5F30437F7;\n\tTue,  2 Jan 2024 03:08:07 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id BAF5E402BE;\n\tTue,  2 Jan 2024 03:08:07 +0100 (CET)",
            "from mgamail.intel.com (mgamail.intel.com [192.55.52.88])\n by mails.dpdk.org (Postfix) with ESMTP id 4C079402BD\n for <dev@dpdk.org>; Tue,  2 Jan 2024 03:08:05 +0100 (CET)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 01 Jan 2024 18:07:59 -0800",
            "from dpdk-qzhan15-test02.sh.intel.com ([10.67.115.37])\n by FMSMGA003.fm.intel.com with ESMTP; 01 Jan 2024 18:07:57 -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=1704161285; x=1735697285;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=y8SQPiw7Qv+z629q46ReOkUEcCtpK2khzXDZ8lqdW0Q=;\n b=QRE7BEFPKpps7iEwQQ+4NTCMrQGmxzYt+3GI9q2zg46MDOvvhEVCk15m\n 7oMgs1hFIOBz3zuOqUmFDBlmz42w3Iqgd7nQxFQZ7lhlHS2Dg6MCTYpd3\n 2OyFKNQ8ZM3z5AW8yNJCiu8P5W41kXjzoRZicth2+bbYggs52nhrd5ftK\n 1YUnMxEQu04yrVZRvTufwZNTisqcBQPq9UhXjv6AYz83rHMl+ULubjHXs\n YRmJrpb2hXAOeG/bkR/4tOfhig4pgv/x/3LPU7Fs8ffBTQpXcN4AuS3SA\n 4ZfDri/eJmeDVbnl8ukvCJU2EWc/8+HNBqpQTvlM5h8A2vcWpyb/TLopO g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10940\"; a=\"427991431\"",
            "E=Sophos;i=\"6.04,324,1695711600\"; d=\"scan'208\";a=\"427991431\"",
            "E=McAfee;i=\"6600,9927,10940\"; a=\"870108601\"",
            "E=Sophos;i=\"6.04,324,1695711600\"; d=\"scan'208\";a=\"870108601\""
        ],
        "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 v4 1/2] net/ice: reset Tx sched node during commit",
        "Date": "Tue,  2 Jan 2024 05:28:59 -0500",
        "Message-Id": "<20240102102900.3435496-1-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20231226185428.3158880-1-qi.z.zhang@intel.com>",
        "References": "<20231226185428.3158880-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": "1. Always reset all Tx scheduler at the begining of a commit action.\n   This prevent unexpected remains from previous commit.\n2. Reset all Tx scheduler nodes if a commit failed.\n\nFor leaf node, stop queues which will remove sched node from\nscheduler tree, then start queues which will add sched node back to\ndefault topo.\nFor noleaf node, simply reset to default parameters.\n\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\nv4:\n- show node type in brief mode.\n\nv3:\n- fix incorrect parameter when query rl profile\n\nv2:\n- fix CI build issue\n\n drivers/net/ice/ice_ethdev.h |   1 +\n drivers/net/ice/ice_tm.c     | 134 ++++++++++++++++++++++++++++-------\n 2 files changed, 111 insertions(+), 24 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h\nindex 1338c80d14..3b2db6aaa6 100644\n--- a/drivers/net/ice/ice_ethdev.h\n+++ b/drivers/net/ice/ice_ethdev.h\n@@ -478,6 +478,7 @@ struct ice_tm_node {\n \tstruct ice_tm_node **children;\n \tstruct ice_tm_shaper_profile *shaper_profile;\n \tstruct rte_tm_node_params params;\n+\tstruct ice_sched_node *sched_node;\n };\n \n /* node type of Traffic Manager */\ndiff --git a/drivers/net/ice/ice_tm.c b/drivers/net/ice/ice_tm.c\nindex 1a30524b05..2ae55418b0 100644\n--- a/drivers/net/ice/ice_tm.c\n+++ b/drivers/net/ice/ice_tm.c\n@@ -764,16 +764,94 @@ static int ice_cfg_hw_node(struct ice_hw *hw,\n \treturn 0;\n }\n \n+static struct ice_sched_node *ice_get_vsi_node(struct ice_hw *hw)\n+{\n+\tstruct ice_sched_node *node = hw->port_info->root;\n+\tuint32_t vsi_layer = hw->num_tx_sched_layers - ICE_VSI_LAYER_OFFSET;\n+\tuint32_t i;\n+\n+\tfor (i = 0; i < vsi_layer; i++)\n+\t\tnode = node->children[0];\n+\n+\treturn node;\n+}\n+\n+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+\tint ret;\n+\n+\t/* reset vsi_node */\n+\tret = ice_set_node_rate(hw, NULL, vsi_node->info.node_teid, ICE_AGG_TYPE_VSI);\n+\tif (ret) {\n+\t\tPMD_DRV_LOG(ERR, \"reset vsi node failed\");\n+\t\treturn ret;\n+\t}\n+\n+\t/* reset queue group nodes */\n+\tTAILQ_FOREACH(tm_node, qgroup_list, node) {\n+\t\tif (tm_node->sched_node == NULL)\n+\t\t\tcontinue;\n+\n+\t\tret = ice_cfg_hw_node(hw, NULL,\n+\t\t\t\t      tm_node->sched_node,\n+\t\t\t\t      ICE_AGG_TYPE_Q);\n+\n+\t\tif (ret) {\n+\t\t\tPMD_DRV_LOG(ERR, \"reset queue group node %u failed\", tm_node->id);\n+\t\t\treturn ret;\n+\t\t}\n+\t\ttm_node->sched_node = NULL;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int ice_remove_leaf_nodes(struct rte_eth_dev *dev)\n+{\n+\tint ret = 0;\n+\tint i;\n+\n+\tfor (i = 0; i < dev->data->nb_tx_queues; i++) {\n+\t\tret = ice_tx_queue_stop(dev, i);\n+\t\tif (ret) {\n+\t\t\tPMD_DRV_LOG(ERR, \"stop queue %u failed\", i);\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\treturn ret;\n+}\n+\n+static int ice_add_leaf_nodes(struct rte_eth_dev *dev)\n+{\n+\tint ret = 0;\n+\tint i;\n+\n+\tfor (i = 0; i < dev->data->nb_tx_queues; i++) {\n+\t\tret = ice_tx_queue_start(dev, i);\n+\t\tif (ret) {\n+\t\t\tPMD_DRV_LOG(ERR, \"start queue %u failed\", i);\n+\t\t\tbreak;\n+\t\t}\n+\t}\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+\t\t\t\t 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 = NULL;\n \tstruct ice_sched_node *queue_node;\n \tstruct ice_tx_queue *txq;\n@@ -785,23 +863,25 @@ static int ice_hierarchy_commit(struct rte_eth_dev *dev,\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/* remove leaf nodes */\n+\tret_val = ice_remove_leaf_nodes(dev);\n+\tif (ret_val) {\n+\t\terror->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;\n+\t\tPMD_DRV_LOG(ERR, \"reset no-leaf nodes failed\");\n+\t\tgoto fail_clear;\n \t}\n \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+\t/* reset no-leaf nodes. */\n+\tret_val = ice_reset_noleaf_nodes(dev);\n+\tif (ret_val) {\n+\t\terror->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;\n+\t\tPMD_DRV_LOG(ERR, \"reset leaf nodes failed\");\n+\t\tgoto add_leaf;\n+\t}\n \n+\t/* config vsi node */\n+\tvsi_node = ice_get_vsi_node(hw);\n \ttm_node = TAILQ_FIRST(&pf->tm_conf.vsi_list);\n \n \tret_val = ice_set_node_rate(hw, tm_node,\n@@ -812,9 +892,10 @@ static int ice_hierarchy_commit(struct rte_eth_dev *dev,\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\tgoto reset_vsi;\n+\t\tgoto add_leaf;\n \t}\n \n+\t/* config queue group nodes */\n \tnb_vsi_child = vsi_node->num_children;\n \tnb_qg = vsi_node->children[0]->num_children;\n \n@@ -833,7 +914,7 @@ static int ice_hierarchy_commit(struct rte_eth_dev *dev,\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 reset_vsi;\n+\t\t\t\tgoto reset_leaf;\n \t\t\t}\n \t\t\ttxq = dev->data->tx_queues[qid];\n \t\t\tq_teid = txq->q_teid;\n@@ -841,7 +922,7 @@ static int ice_hierarchy_commit(struct rte_eth_dev *dev,\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 reset_vsi;\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@@ -849,19 +930,20 @@ static int ice_hierarchy_commit(struct rte_eth_dev *dev,\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 reset_vsi;\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,\n \t\t\t\t\t  qgroup_sched_node,\n \t\t\t\t\t  ICE_AGG_TYPE_Q);\n+\t\ttm_node->sched_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_vsi;\n+\t\t\tgoto reset_leaf;\n \t\t}\n \n \t\tidx_qg++;\n@@ -872,10 +954,11 @@ static int ice_hierarchy_commit(struct rte_eth_dev *dev,\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, \"too many queues\");\n-\t\t\tgoto reset_vsi;\n+\t\t\tgoto reset_leaf;\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@@ -890,14 +973,17 @@ static int ice_hierarchy_commit(struct rte_eth_dev *dev,\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_vsi;\n+\t\t\tgoto reset_leaf;\n \t\t}\n \t}\n \n \treturn ret_val;\n \n-reset_vsi:\n-\tice_set_node_rate(hw, NULL, vsi_node->info.node_teid, ICE_AGG_TYPE_VSI);\n+reset_leaf:\n+\tice_remove_leaf_nodes(dev);\n+add_leaf:\n+\tice_add_leaf_nodes(dev);\n+\tice_reset_noleaf_nodes(dev);\n fail_clear:\n \t/* clear all the traffic manager configuration */\n \tif (clear_on_fail) {\n",
    "prefixes": [
        "v4",
        "1/2"
    ]
}