get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 54681,
    "url": "http://patches.dpdk.org/api/patches/54681/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190611155221.2703-23-leyi.rong@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": "<20190611155221.2703-23-leyi.rong@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190611155221.2703-23-leyi.rong@intel.com",
    "date": "2019-06-11T15:51:37",
    "name": "[v2,22/66] net/ice/base: added sibling head to parse nodes",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "fff5400932e2402232c0eeb8d80b7f4a7565cd9b",
    "submitter": {
        "id": 1204,
        "url": "http://patches.dpdk.org/api/people/1204/?format=api",
        "name": "Leyi Rong",
        "email": "leyi.rong@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/20190611155221.2703-23-leyi.rong@intel.com/mbox/",
    "series": [
        {
            "id": 4981,
            "url": "http://patches.dpdk.org/api/series/4981/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4981",
            "date": "2019-06-11T15:51:15",
            "name": "shared code update",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/4981/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/54681/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/54681/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 90C771C514;\n\tTue, 11 Jun 2019 17:54:36 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id BD18A1C49C\n\tfor <dev@dpdk.org>; Tue, 11 Jun 2019 17:54:05 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t11 Jun 2019 08:54:05 -0700",
            "from lrong-srv-03.sh.intel.com ([10.67.119.177])\n\tby orsmga001.jf.intel.com with ESMTP; 11 Jun 2019 08:54:04 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Leyi Rong <leyi.rong@intel.com>",
        "To": "qi.z.zhang@intel.com",
        "Cc": "dev@dpdk.org, Leyi Rong <leyi.rong@intel.com>,\n\tVictor Raj <victor.raj@intel.com>,\n\tPaul M Stillwell Jr <paul.m.stillwell.jr@intel.com>",
        "Date": "Tue, 11 Jun 2019 23:51:37 +0800",
        "Message-Id": "<20190611155221.2703-23-leyi.rong@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190611155221.2703-1-leyi.rong@intel.com>",
        "References": "<20190604054248.68510-1-leyi.rong@intel.com>\n\t<20190611155221.2703-1-leyi.rong@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 22/66] net/ice/base: added sibling head to\n\tparse nodes",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "There was a bug in the previous code which never traverses all the\nchildren to get the first node of the requested layer.\n\nAdded a sibling head pointer to point the first node of each layer\nper TC. This helps the traverse easy and quicker and also removed the\nrecursive, complexity of the code.\n\nSigned-off-by: Victor Raj <victor.raj@intel.com>\nSigned-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>\nSigned-off-by: Leyi Rong <leyi.rong@intel.com>\n---\n drivers/net/ice/base/ice_sched.c | 61 ++++++++++++--------------------\n drivers/net/ice/base/ice_type.h  |  2 ++\n 2 files changed, 25 insertions(+), 38 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c\nindex 855e3848c..0c1c18ba1 100644\n--- a/drivers/net/ice/base/ice_sched.c\n+++ b/drivers/net/ice/base/ice_sched.c\n@@ -260,33 +260,17 @@ ice_sched_remove_elems(struct ice_hw *hw, struct ice_sched_node *parent,\n \n /**\n  * ice_sched_get_first_node - get the first node of the given layer\n- * @hw: pointer to the HW struct\n+ * @pi: port information structure\n  * @parent: pointer the base node of the subtree\n  * @layer: layer number\n  *\n  * This function retrieves the first node of the given layer from the subtree\n  */\n static struct ice_sched_node *\n-ice_sched_get_first_node(struct ice_hw *hw, struct ice_sched_node *parent,\n-\t\t\t u8 layer)\n+ice_sched_get_first_node(struct ice_port_info *pi,\n+\t\t\t struct ice_sched_node *parent, u8 layer)\n {\n-\tu8 i;\n-\n-\tif (layer < hw->sw_entry_point_layer)\n-\t\treturn NULL;\n-\tfor (i = 0; i < parent->num_children; i++) {\n-\t\tstruct ice_sched_node *node = parent->children[i];\n-\n-\t\tif (node) {\n-\t\t\tif (node->tx_sched_layer == layer)\n-\t\t\t\treturn node;\n-\t\t\t/* this recursion is intentional, and wouldn't\n-\t\t\t * go more than 9 calls\n-\t\t\t */\n-\t\t\treturn ice_sched_get_first_node(hw, node, layer);\n-\t\t}\n-\t}\n-\treturn NULL;\n+\treturn pi->sib_head[parent->tc_num][layer];\n }\n \n /**\n@@ -342,7 +326,7 @@ void ice_free_sched_node(struct ice_port_info *pi, struct ice_sched_node *node)\n \tparent = node->parent;\n \t/* root has no parent */\n \tif (parent) {\n-\t\tstruct ice_sched_node *p, *tc_node;\n+\t\tstruct ice_sched_node *p;\n \n \t\t/* update the parent */\n \t\tfor (i = 0; i < parent->num_children; i++)\n@@ -354,16 +338,7 @@ void ice_free_sched_node(struct ice_port_info *pi, struct ice_sched_node *node)\n \t\t\t\tbreak;\n \t\t\t}\n \n-\t\t/* search for previous sibling that points to this node and\n-\t\t * remove the reference\n-\t\t */\n-\t\ttc_node = ice_sched_get_tc_node(pi, node->tc_num);\n-\t\tif (!tc_node) {\n-\t\t\tice_debug(hw, ICE_DBG_SCHED,\n-\t\t\t\t  \"Invalid TC number %d\\n\", node->tc_num);\n-\t\t\tgoto err_exit;\n-\t\t}\n-\t\tp = ice_sched_get_first_node(hw, tc_node, node->tx_sched_layer);\n+\t\tp = ice_sched_get_first_node(pi, node, node->tx_sched_layer);\n \t\twhile (p) {\n \t\t\tif (p->sibling == node) {\n \t\t\t\tp->sibling = node->sibling;\n@@ -371,8 +346,13 @@ void ice_free_sched_node(struct ice_port_info *pi, struct ice_sched_node *node)\n \t\t\t}\n \t\t\tp = p->sibling;\n \t\t}\n+\n+\t\t/* update the sibling head if head is getting removed */\n+\t\tif (pi->sib_head[node->tc_num][node->tx_sched_layer] == node)\n+\t\t\tpi->sib_head[node->tc_num][node->tx_sched_layer] =\n+\t\t\t\tnode->sibling;\n \t}\n-err_exit:\n+\n \t/* leaf nodes have no children */\n \tif (node->children)\n \t\tice_free(hw, node->children);\n@@ -979,13 +959,17 @@ ice_sched_add_elems(struct ice_port_info *pi, struct ice_sched_node *tc_node,\n \n \t\t/* add it to previous node sibling pointer */\n \t\t/* Note: siblings are not linked across branches */\n-\t\tprev = ice_sched_get_first_node(hw, tc_node, layer);\n+\t\tprev = ice_sched_get_first_node(pi, tc_node, layer);\n \t\tif (prev && prev != new_node) {\n \t\t\twhile (prev->sibling)\n \t\t\t\tprev = prev->sibling;\n \t\t\tprev->sibling = new_node;\n \t\t}\n \n+\t\t/* initialize the sibling head */\n+\t\tif (!pi->sib_head[tc_node->tc_num][layer])\n+\t\t\tpi->sib_head[tc_node->tc_num][layer] = new_node;\n+\n \t\tif (i == 0)\n \t\t\t*first_node_teid = teid;\n \t}\n@@ -1451,7 +1435,7 @@ ice_sched_get_free_qparent(struct ice_port_info *pi, u16 vsi_handle, u8 tc,\n \t\tgoto lan_q_exit;\n \n \t/* get the first queue group node from VSI sub-tree */\n-\tqgrp_node = ice_sched_get_first_node(pi->hw, vsi_node, qgrp_layer);\n+\tqgrp_node = ice_sched_get_first_node(pi, vsi_node, qgrp_layer);\n \twhile (qgrp_node) {\n \t\t/* make sure the qgroup node is part of the VSI subtree */\n \t\tif (ice_sched_find_node_in_subtree(pi->hw, vsi_node, qgrp_node))\n@@ -1482,7 +1466,7 @@ ice_sched_get_vsi_node(struct ice_hw *hw, struct ice_sched_node *tc_node,\n \tu8 vsi_layer;\n \n \tvsi_layer = ice_sched_get_vsi_layer(hw);\n-\tnode = ice_sched_get_first_node(hw, tc_node, vsi_layer);\n+\tnode = ice_sched_get_first_node(hw->port_info, tc_node, vsi_layer);\n \n \t/* Check whether it already exists */\n \twhile (node) {\n@@ -1511,7 +1495,7 @@ ice_sched_get_agg_node(struct ice_hw *hw, struct ice_sched_node *tc_node,\n \tu8 agg_layer;\n \n \tagg_layer = ice_sched_get_agg_layer(hw);\n-\tnode = ice_sched_get_first_node(hw, tc_node, agg_layer);\n+\tnode = ice_sched_get_first_node(hw->port_info, tc_node, agg_layer);\n \n \t/* Check whether it already exists */\n \twhile (node) {\n@@ -1663,7 +1647,8 @@ ice_sched_calc_vsi_support_nodes(struct ice_hw *hw,\n \t\t\t/* If intermediate nodes are reached max children\n \t\t\t * then add a new one.\n \t\t\t */\n-\t\t\tnode = ice_sched_get_first_node(hw, tc_node, (u8)i);\n+\t\t\tnode = ice_sched_get_first_node(hw->port_info, tc_node,\n+\t\t\t\t\t\t\t(u8)i);\n \t\t\t/* scan all the siblings */\n \t\t\twhile (node) {\n \t\t\t\tif (node->num_children < hw->max_children[i])\n@@ -2528,7 +2513,7 @@ ice_sched_add_agg_cfg(struct ice_port_info *pi, u32 agg_id, u8 tc)\n \t * intermediate node on those layers\n \t */\n \tfor (i = hw->sw_entry_point_layer; i < aggl; i++) {\n-\t\tparent = ice_sched_get_first_node(hw, tc_node, i);\n+\t\tparent = ice_sched_get_first_node(pi, tc_node, i);\n \n \t\t/* scan all the siblings */\n \t\twhile (parent) {\ndiff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h\nindex 5da267f1b..3523b0c35 100644\n--- a/drivers/net/ice/base/ice_type.h\n+++ b/drivers/net/ice/base/ice_type.h\n@@ -679,6 +679,8 @@ struct ice_port_info {\n \tstruct ice_mac_info mac;\n \tstruct ice_phy_info phy;\n \tstruct ice_lock sched_lock;\t/* protect access to TXSched tree */\n+\tstruct ice_sched_node *\n+\t\tsib_head[ICE_MAX_TRAFFIC_CLASS][ICE_AQC_TOPO_MAX_LEVEL_NUM];\n \t/* List contain profile ID(s) and other params per layer */\n \tstruct LIST_HEAD_TYPE rl_prof_list[ICE_AQC_TOPO_MAX_LEVEL_NUM];\n \tstruct ice_dcbx_cfg local_dcbx_cfg;\t/* Oper/Local Cfg */\n",
    "prefixes": [
        "v2",
        "22/66"
    ]
}