Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/989704/?format=api
{ "id": 989704, "url": "http://patchwork.ozlabs.org/api/patches/989704/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20181026174105.11628-14-anirudh.venkataramanan@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": "<20181026174105.11628-14-anirudh.venkataramanan@intel.com>", "list_archive_url": null, "date": "2018-10-26T17:41:02", "name": "[S8,13/16] ice: Remove node before releasing VSI", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "5baa98f41e770f91b73998b0c8c5147c33793786", "submitter": { "id": 73601, "url": "http://patchwork.ozlabs.org/api/people/73601/?format=api", "name": "Anirudh Venkataramanan", "email": "anirudh.venkataramanan@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/20181026174105.11628-14-anirudh.venkataramanan@intel.com/mbox/", "series": [ { "id": 72783, "url": "http://patchwork.ozlabs.org/api/series/72783/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=72783", "date": "2018-10-26T17:40:52", "name": "Bug fixes for ice, set 1/2", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/72783/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/989704/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/989704/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.137; helo=fraxinus.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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\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 42hWk63rfXz9sLt\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 27 Oct 2018 04:50:38 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id BFC4D87771;\n\tFri, 26 Oct 2018 17:50:36 +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 7M5TcgVV3F6u; Fri, 26 Oct 2018 17:50:34 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id DE49B875F5;\n\tFri, 26 Oct 2018 17:50:34 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id CC7811BF30F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 26 Oct 2018 17:50:28 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id CA24A88726\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 26 Oct 2018 17:50:28 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id S2zio3CzeN7D for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 26 Oct 2018 17:50:28 +0000 (UTC)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 3721588720\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 26 Oct 2018 17:50:28 +0000 (UTC)", "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t26 Oct 2018 10:41:06 -0700", "from shasta.jf.intel.com ([10.166.241.11])\n\tby orsmga004.jf.intel.com with ESMTP; 26 Oct 2018 10:41:05 -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.54,428,1534834800\"; d=\"scan'208\";a=\"244654994\"", "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Fri, 26 Oct 2018 10:41:02 -0700", "Message-Id": "<20181026174105.11628-14-anirudh.venkataramanan@intel.com>", "X-Mailer": "git-send-email 2.14.3", "In-Reply-To": "<20181026174105.11628-1-anirudh.venkataramanan@intel.com>", "References": "<20181026174105.11628-1-anirudh.venkataramanan@intel.com>", "Subject": "[Intel-wired-lan] [PATCH S8 13/16] ice: Remove node before\n\treleasing VSI", "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>", "MIME-Version": "1.0", "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": "Before releasing the VSI, remove the VSI scheduler node. If not,\nthe node is left in the scheduler tree and, on subsequent load, the\nscheduler tree contains the node so it does not set it in vsi_ctx.\nThis, later, causes the node to not be found in ice_sched_get_free_qparent\nwhich leads to a \"Failed to set LAN Tx queue context, error: -1\".\n\nTo remove the scheduler node, this patch introduces ice_rm_vsi_lan_cfg\nand related helpers.\n\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_lib.c | 1 +\n drivers/net/ethernet/intel/ice/ice_sched.c | 108 ++++++++++++++++++++++++++++-\n drivers/net/ethernet/intel/ice/ice_sched.h | 2 +\n 3 files changed, 110 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c\nindex 11d0ab185dd2..1efd760debc2 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.c\n@@ -2492,6 +2492,7 @@ int ice_vsi_release(struct ice_vsi *vsi)\n \t}\n \n \tice_remove_vsi_fltr(&pf->hw, vsi->idx);\n+\tice_rm_vsi_lan_cfg(vsi->port_info, vsi->idx);\n \tice_vsi_delete(vsi);\n \tice_vsi_free_q_vectors(vsi);\n \tice_vsi_clear_rings(vsi);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_sched.c b/drivers/net/ethernet/intel/ice/ice_sched.c\nindex 7cc8aa18a22b..3d57f5b4834d 100644\n--- a/drivers/net/ethernet/intel/ice/ice_sched.c\n+++ b/drivers/net/ethernet/intel/ice/ice_sched.c\n@@ -1527,7 +1527,7 @@ ice_sched_update_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_handle,\n }\n \n /**\n- * ice_sched_cfg_vsi - configure the new/exisiting VSI\n+ * ice_sched_cfg_vsi - configure the new/existing VSI\n * @pi: port information structure\n * @vsi_handle: software VSI handle\n * @tc: TC number\n@@ -1605,3 +1605,109 @@ ice_sched_cfg_vsi(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 maxqs,\n \n \treturn status;\n }\n+\n+/**\n+ * ice_sched_rm_agg_vsi_entry - remove agg related vsi info entry\n+ * @pi: port information structure\n+ * @vsi_handle: software VSI handle\n+ *\n+ * This function removes single aggregator vsi info entry from\n+ * aggregator list.\n+ */\n+static void\n+ice_sched_rm_agg_vsi_info(struct ice_port_info *pi, u16 vsi_handle)\n+{\n+\tstruct ice_sched_agg_info *agg_info;\n+\tstruct ice_sched_agg_info *atmp;\n+\n+\tlist_for_each_entry_safe(agg_info, atmp, &pi->agg_list, list_entry) {\n+\t\tstruct ice_sched_agg_vsi_info *agg_vsi_info;\n+\t\tstruct ice_sched_agg_vsi_info *vtmp;\n+\n+\t\tlist_for_each_entry_safe(agg_vsi_info, vtmp,\n+\t\t\t\t\t &agg_info->agg_vsi_list, list_entry)\n+\t\t\tif (agg_vsi_info->vsi_handle == vsi_handle) {\n+\t\t\t\tlist_del(&agg_vsi_info->list_entry);\n+\t\t\t\tdevm_kfree(ice_hw_to_dev(pi->hw),\n+\t\t\t\t\t agg_vsi_info);\n+\t\t\t\treturn;\n+\t\t\t}\n+\t}\n+}\n+\n+/**\n+ * ice_sched_rm_vsi_cfg - remove the VSI and its children nodes\n+ * @pi: port information structure\n+ * @vsi_handle: software VSI handle\n+ * @owner: lan or rdma\n+ *\n+ * This function removes the VSI and its lan or rdma children nodes from the\n+ * scheduler tree.\n+ */\n+static enum ice_status\n+ice_sched_rm_vsi_cfg(struct ice_port_info *pi, u16 vsi_handle, u8 owner)\n+{\n+\tenum ice_status status = ICE_ERR_PARAM;\n+\tstruct ice_vsi_ctx *vsi_ctx;\n+\tu8 i, j = 0;\n+\n+\tif (!ice_is_vsi_valid(pi->hw, vsi_handle))\n+\t\treturn status;\n+\tmutex_lock(&pi->sched_lock);\n+\tvsi_ctx = ice_get_vsi_ctx(pi->hw, vsi_handle);\n+\tif (!vsi_ctx)\n+\t\tgoto exit_sched_rm_vsi_cfg;\n+\n+\tfor (i = 0; i < ICE_MAX_TRAFFIC_CLASS; i++) {\n+\t\tstruct ice_sched_node *vsi_node, *tc_node;\n+\n+\t\ttc_node = ice_sched_get_tc_node(pi, i);\n+\t\tif (!tc_node)\n+\t\t\tcontinue;\n+\n+\t\tvsi_node = ice_sched_get_vsi_node(pi->hw, tc_node, vsi_handle);\n+\t\tif (!vsi_node)\n+\t\t\tcontinue;\n+\n+\t\twhile (j < vsi_node->num_children) {\n+\t\t\tif (vsi_node->children[j]->owner == owner) {\n+\t\t\t\tice_free_sched_node(pi, vsi_node->children[j]);\n+\n+\t\t\t\t/* reset the counter again since the num\n+\t\t\t\t * children will be updated after node removal\n+\t\t\t\t */\n+\t\t\t\tj = 0;\n+\t\t\t} else {\n+\t\t\t\tj++;\n+\t\t\t}\n+\t\t}\n+\t\t/* remove the VSI if it has no children */\n+\t\tif (!vsi_node->num_children) {\n+\t\t\tice_free_sched_node(pi, vsi_node);\n+\t\t\tvsi_ctx->sched.vsi_node[i] = NULL;\n+\n+\t\t\t/* clean up agg related vsi info if any */\n+\t\t\tice_sched_rm_agg_vsi_info(pi, vsi_handle);\n+\t\t}\n+\t\tif (owner == ICE_SCHED_NODE_OWNER_LAN)\n+\t\t\tvsi_ctx->sched.max_lanq[i] = 0;\n+\t}\n+\tstatus = 0;\n+\n+exit_sched_rm_vsi_cfg:\n+\tmutex_unlock(&pi->sched_lock);\n+\treturn status;\n+}\n+\n+/**\n+ * ice_rm_vsi_lan_cfg - remove VSI and its lan children nodes\n+ * @pi: port information structure\n+ * @vsi_handle: software VSI handle\n+ *\n+ * This function clears the VSI and its lan children nodes from scheduler tree\n+ * for all TCs.\n+ */\n+enum ice_status ice_rm_vsi_lan_cfg(struct ice_port_info *pi, u16 vsi_handle)\n+{\n+\treturn ice_sched_rm_vsi_cfg(pi, vsi_handle, ICE_SCHED_NODE_OWNER_LAN);\n+}\ndiff --git a/drivers/net/ethernet/intel/ice/ice_sched.h b/drivers/net/ethernet/intel/ice/ice_sched.h\nindex 5dc9cfa04c58..dc59fbac7dde 100644\n--- a/drivers/net/ethernet/intel/ice/ice_sched.h\n+++ b/drivers/net/ethernet/intel/ice/ice_sched.h\n@@ -12,6 +12,7 @@\n struct ice_sched_agg_vsi_info {\n \tstruct list_head list_entry;\n \tDECLARE_BITMAP(tc_bitmap, ICE_MAX_TRAFFIC_CLASS);\n+\tu16 vsi_handle;\n };\n \n struct ice_sched_agg_info {\n@@ -39,4 +40,5 @@ ice_sched_get_free_qparent(struct ice_port_info *pi, u16 vsi_handle, u8 tc,\n enum ice_status\n ice_sched_cfg_vsi(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 maxqs,\n \t\t u8 owner, bool enable);\n+enum ice_status ice_rm_vsi_lan_cfg(struct ice_port_info *pi, u16 vsi_handle);\n #endif /* _ICE_SCHED_H_ */\n", "prefixes": [ "S8", "13/16" ] }