Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1245989/?format=api
{ "id": 1245989, "url": "http://patchwork.ozlabs.org/api/patches/1245989/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200227181505.61720-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": "<20200227181505.61720-5-anthony.l.nguyen@intel.com>", "list_archive_url": null, "date": "2020-02-27T18:14:55", "name": "[S40,05/15] ice: Fix removing driver while bare-metal VFs pass traffic", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "24c2f7a87df6eaf6306ef533e9f3883b76b514b7", "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/20200227181505.61720-5-anthony.l.nguyen@intel.com/mbox/", "series": [ { "id": 161280, "url": "http://patchwork.ozlabs.org/api/series/161280/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=161280", "date": "2020-02-27T18:14:51", "name": "[S40,01/15] iavf: Enable support for up to 16 queues", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/161280/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1245989/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1245989/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; spf=pass (sender SPF authorized)\n\tsmtp.mailfrom=osuosl.org (client-ip=140.211.166.133;\n\thelo=hemlock.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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 48T17j5dpXz9sSV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 28 Feb 2020 05:16:01 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 0C09F88045;\n\tThu, 27 Feb 2020 18:16:00 +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 zgjJoqC9A-nj; Thu, 27 Feb 2020 18:15:58 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id D601C87FF7;\n\tThu, 27 Feb 2020 18:15:58 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 694ED1BF3D2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 27 Feb 2020 18:15:55 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 621F488002\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 27 Feb 2020 18:15:55 +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 wl00o+me6ej3 for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 27 Feb 2020 18:15:54 +0000 (UTC)", "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id BDCE488007\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 27 Feb 2020 18:15:53 +0000 (UTC)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t27 Feb 2020 10:15:52 -0800", "from unknown (HELO localhost.jf.intel.com) ([10.166.244.174])\n\tby FMSMGA003.fm.intel.com with ESMTP; 27 Feb 2020 10:15:52 -0800" ], "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.70,492,1574150400\"; d=\"scan'208\";a=\"285408846\"", "From": "Tony Nguyen <anthony.l.nguyen@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Thu, 27 Feb 2020 10:14:55 -0800", "Message-Id": "<20200227181505.61720-5-anthony.l.nguyen@intel.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20200227181505.61720-1-anthony.l.nguyen@intel.com>", "References": "<20200227181505.61720-1-anthony.l.nguyen@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH S40 05/15] ice: Fix removing driver while\n\tbare-metal VFs pass traffic", "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: Brett Creeley <brett.creeley@intel.com>\n\nCurrently, if there are bare-metal VFs passing traffic and the ice\ndriver is removed, there is a possibility of VFs triggering a Tx timeout\nright before iavf_remove(). This is causing iavf_close() to not be\ncalled because there is a check in the beginning of iavf_remove() that\nbails out early if (adapter->state < IAVF_DOWN_PENDING). This makes it\nso some resources do not get cleaned up. Specifically, free_irq()\nis never called for data interrupts, which results in the following line\nof code to trigger:\n\npci_disable_msix()\n\tfree_msi_irqs()\n\t\t...\n\t\tBUG_ON(irq_has_action(entry->irq + i));\n\t\t...\n\nTo prevent the Tx timeout from occurring on the VF during driver unload\nfor ice and the iavf there are a few changes that are needed.\n\n[1] Don't disable all active VF Tx/Rx queues prior to calling\npci_disable_sriov.\n\n[2] Call ice_free_vfs() before disabling the service task.\n\n[3] Disable VF resets when the ice driver is being unloaded by setting\nthe pf->state flag __ICE_VF_RESETS_DISABLED.\n\nChanging [1] and [2] allow each VF driver's remove flow to successfully\nsend VIRTCHNL requests, which includes queue disable. This prevents\nunexpected Tx timeouts because the PF driver is no longer forcefully\ndisabling queues.\n\nDue to [1] and [2] there is a possibility that the PF driver will get a\nVFLR or reset request over VIRTCHNL from a VF during PF driver unload.\nPrevent that by doing [3].\n\nSigned-off-by: Brett Creeley <brett.creeley@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice.h | 1 +\n drivers/net/ethernet/intel/ice/ice_main.c | 19 +++++++++++++++----\n .../net/ethernet/intel/ice/ice_virtchnl_pf.c | 19 +++++++++++++------\n 3 files changed, 29 insertions(+), 10 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h\nindex bdd6d8a732f5..b32d9ed35b21 100644\n--- a/drivers/net/ethernet/intel/ice/ice.h\n+++ b/drivers/net/ethernet/intel/ice/ice.h\n@@ -220,6 +220,7 @@ enum ice_state {\n \t__ICE_SERVICE_DIS,\n \t__ICE_OICR_INTR_DIS,\t\t/* Global OICR interrupt disabled */\n \t__ICE_MDD_VF_PRINT_PENDING,\t/* set when MDD event handle */\n+\t__ICE_VF_RESETS_DISABLED,\t/* disable resets during ice_remove */\n \t__ICE_STATE_NBITS\t\t/* must be last */\n };\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex 933f41455628..13ac6073a75d 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -2060,8 +2060,16 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)\n \t\tset_bit(__ICE_MDD_EVENT_PENDING, pf->state);\n \t}\n \tif (oicr & PFINT_OICR_VFLR_M) {\n-\t\tena_mask &= ~PFINT_OICR_VFLR_M;\n-\t\tset_bit(__ICE_VFLR_EVENT_PENDING, pf->state);\n+\t\t/* disable any further VFLR event notifications */\n+\t\tif (test_bit(__ICE_VF_RESETS_DISABLED, pf->state)) {\n+\t\t\tu32 reg = rd32(hw, PFINT_OICR_ENA);\n+\n+\t\t\treg &= ~PFINT_OICR_VFLR_M;\n+\t\t\twr32(hw, PFINT_OICR_ENA, reg);\n+\t\t} else {\n+\t\t\tena_mask &= ~PFINT_OICR_VFLR_M;\n+\t\t\tset_bit(__ICE_VFLR_EVENT_PENDING, pf->state);\n+\t\t}\n \t}\n \n \tif (oicr & PFINT_OICR_GRST_M) {\n@@ -3457,6 +3465,11 @@ static void ice_remove(struct pci_dev *pdev)\n \t\tmsleep(100);\n \t}\n \n+\tif (test_bit(ICE_FLAG_SRIOV_ENA, pf->flags)) {\n+\t\tset_bit(__ICE_VF_RESETS_DISABLED, pf->state);\n+\t\tice_free_vfs(pf);\n+\t}\n+\n \tice_service_task_stop(pf);\n \tif (ice_is_peer_ena(pf)) {\n \t\treason = IIDC_REASON_INTERFACE_DOWN;\n@@ -3464,8 +3477,6 @@ static void ice_remove(struct pci_dev *pdev)\n \t}\n \tset_bit(__ICE_DOWN, pf->state);\n \n-\tif (test_bit(ICE_FLAG_SRIOV_ENA, pf->flags))\n-\t\tice_free_vfs(pf);\n \tice_vsi_release_all(pf);\n \tif (ice_is_peer_ena(pf)) {\n \t\tice_for_each_peer(pf, NULL, ice_unreg_peer_device);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\nindex 48791fc387ba..5fb457479060 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n@@ -300,11 +300,6 @@ void ice_free_vfs(struct ice_pf *pf)\n \twhile (test_and_set_bit(__ICE_VF_DIS, pf->state))\n \t\tusleep_range(1000, 2000);\n \n-\t/* Avoid wait time by stopping all VFs at the same time */\n-\tice_for_each_vf(pf, i)\n-\t\tif (test_bit(ICE_VF_STATE_QS_ENA, pf->vf[i].vf_states))\n-\t\t\tice_dis_vf_qs(&pf->vf[i]);\n-\n \t/* Disable IOV before freeing resources. This lets any VF drivers\n \t * running in the host get themselves cleaned up before we yank\n \t * the carpet out from underneath their feet.\n@@ -314,6 +309,11 @@ void ice_free_vfs(struct ice_pf *pf)\n \telse\n \t\tdev_warn(dev, \"VFs are assigned - not disabling SR-IOV\\n\");\n \n+\t/* Avoid wait time by stopping all VFs at the same time */\n+\tice_for_each_vf(pf, i)\n+\t\tif (test_bit(ICE_VF_STATE_QS_ENA, pf->vf[i].vf_states))\n+\t\t\tice_dis_vf_qs(&pf->vf[i]);\n+\n \ttmp = pf->num_alloc_vfs;\n \tpf->num_qps_per_vf = 0;\n \tpf->num_alloc_vfs = 0;\n@@ -1155,7 +1155,8 @@ static bool ice_is_vf_disabled(struct ice_vf *vf)\n * @vf: pointer to the VF structure\n * @is_vflr: true if VFLR was issued, false if not\n *\n- * Returns true if the VF is reset, false otherwise.\n+ * Returns true if the VF is currently in reset, resets successfully, or resets\n+ * are disabled and false otherwise.\n */\n bool ice_reset_vf(struct ice_vf *vf, bool is_vflr)\n {\n@@ -1170,6 +1171,12 @@ bool ice_reset_vf(struct ice_vf *vf, bool is_vflr)\n \n \tdev = ice_pf_to_dev(pf);\n \n+\tif (test_bit(__ICE_VF_RESETS_DISABLED, pf->state)) {\n+\t\tdev_dbg(dev, \"Trying to reset VF %d, but all VF resets are disabled\\n\",\n+\t\t\tvf->vf_id);\n+\t\treturn true;\n+\t}\n+\n \tif (ice_is_vf_disabled(vf)) {\n \t\tdev_dbg(dev, \"VF is already disabled, there is no need for resetting it, telling VM, all is fine %d\\n\",\n \t\t\tvf->vf_id);\n", "prefixes": [ "S40", "05/15" ] }