Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1137056/?format=api
{ "id": 1137056, "url": "http://patchwork.ozlabs.org/api/patches/1137056/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190725095401.24590-5-anthony.l.nguyen@intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20190725095401.24590-5-anthony.l.nguyen@intel.com>", "list_archive_url": null, "date": "2019-07-25T09:53:54", "name": "[S25,05/12] ice: added sibling head to parse nodes", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "a61fb73f5ad38ff63dc4e6798e29bec96c077ca5", "submitter": { "id": 68875, "url": "http://patchwork.ozlabs.org/api/people/68875/?format=api", "name": "Tony Nguyen", "email": "anthony.l.nguyen@intel.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190725095401.24590-5-anthony.l.nguyen@intel.com/mbox/", "series": [ { "id": 121514, "url": "http://patchwork.ozlabs.org/api/series/121514/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=121514", "date": "2019-07-25T09:53:50", "name": "[S25,01/12] ice: update ethtool stats on-demand", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/121514/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1137056/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1137056/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.138; helo=whitealder.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 45vgYK2LjLz9sBt\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 26 Jul 2019 04:22:29 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id B344D8746E;\n\tThu, 25 Jul 2019 18:22:27 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id uymmkHV9xa9H; Thu, 25 Jul 2019 18:22:23 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 9C5F28746D;\n\tThu, 25 Jul 2019 18:22:21 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 60C8A1BF988\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 25 Jul 2019 18:22:19 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 5E93886582\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 25 Jul 2019 18:22:19 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id PXrswkE_PWTB for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 25 Jul 2019 18:22:18 +0000 (UTC)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 6DE4E86594\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 25 Jul 2019 18:22:18 +0000 (UTC)", "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Jul 2019 11:22:17 -0700", "from unknown (HELO localhost.jf.intel.com) ([10.166.244.174])\n\tby fmsmga004.fm.intel.com with ESMTP; 25 Jul 2019 11:22:17 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.64,307,1559545200\"; d=\"scan'208\";a=\"193897604\"", "From": "Tony Nguyen <anthony.l.nguyen@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Thu, 25 Jul 2019 02:53:54 -0700", "Message-Id": "<20190725095401.24590-5-anthony.l.nguyen@intel.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20190725095401.24590-1-anthony.l.nguyen@intel.com>", "References": "<20190725095401.24590-1-anthony.l.nguyen@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH S25 05/12] ice: added sibling head to\n\tparse nodes", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "From: Victor Raj <victor.raj@intel.com>\n\nThere was a bug in the previous code which never traverses all the\nchildren to get the first node of the requested layer. Add a sibling\nhead pointer to point the first node of each layer per TC. This helps\ntraverse easier and quicker and also removes the recursion.\n\nSigned-off-by: Victor Raj <victor.raj@intel.com>\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_sched.c | 57 ++++++++--------------\n drivers/net/ethernet/intel/ice/ice_type.h | 2 +\n 2 files changed, 23 insertions(+), 36 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_sched.c b/drivers/net/ethernet/intel/ice/ice_sched.c\nindex 2a232504379d..79d64f9ed609 100644\n--- a/drivers/net/ethernet/intel/ice/ice_sched.c\n+++ b/drivers/net/ethernet/intel/ice/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\tdevm_kfree(ice_hw_to_dev(hw), node->children);\n@@ -743,13 +723,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@@ -1160,7 +1144,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@@ -1191,7 +1175,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@@ -1316,7 +1300,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])\ndiff --git a/drivers/net/ethernet/intel/ice/ice_type.h b/drivers/net/ethernet/intel/ice/ice_type.h\nindex 24bbef8bbe69..d76e0cb7ef46 100644\n--- a/drivers/net/ethernet/intel/ice/ice_type.h\n+++ b/drivers/net/ethernet/intel/ice/ice_type.h\n@@ -347,6 +347,8 @@ struct ice_port_info {\n \tstruct ice_mac_info mac;\n \tstruct ice_phy_info phy;\n \tstruct mutex 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 \tstruct ice_dcbx_cfg local_dcbx_cfg;\t/* Oper/Local Cfg */\n \t/* DCBX info */\n \tstruct ice_dcbx_cfg remote_dcbx_cfg;\t/* Peer Cfg */\n", "prefixes": [ "S25", "05/12" ] }