Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/631853/?format=api
{ "id": 631853, "url": "http://patchwork.ozlabs.org/api/patches/631853/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160607230902.5457-4-jacob.e.keller@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": "<20160607230902.5457-4-jacob.e.keller@intel.com>", "list_archive_url": null, "date": "2016-06-07T23:08:47", "name": "[v2,03/18] fm10k: don't stop reset due to FM10K_ERR_REQUESTS_PENDING", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "384512e0f984e42ca361ea6756e1d7017aad8e4f", "submitter": { "id": 9784, "url": "http://patchwork.ozlabs.org/api/people/9784/?format=api", "name": "Jacob Keller", "email": "jacob.e.keller@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/20160607230902.5457-4-jacob.e.keller@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/631853/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/631853/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@lists.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" ], "Received": [ "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3rPS1p1Mx6z9t3h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 8 Jun 2016 09:09:18 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id B340E8A765;\n\tTue, 7 Jun 2016 23:09:16 +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 O7QWQsM3fwBb; Tue, 7 Jun 2016 23:09:13 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 71C738A879;\n\tTue, 7 Jun 2016 23:09:10 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 528171C127A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 7 Jun 2016 23:09:08 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 4E7C287F86\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 7 Jun 2016 23:09:08 +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 BeX0O8khBIl8 for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 7 Jun 2016 23:09:06 +0000 (UTC)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id DEBB18819F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 7 Jun 2016 23:09:05 +0000 (UTC)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga104.fm.intel.com with ESMTP; 07 Jun 2016 16:09:05 -0700", "from jekeller-desk.amr.corp.intel.com (HELO\n\tjekeller-desk.jekeller.internal) ([134.134.3.116])\n\tby FMSMGA003.fm.intel.com with ESMTP; 07 Jun 2016 16:09: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-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.26,436,1459839600\"; d=\"scan'208\";a=\"715507146\"", "From": "Jacob Keller <jacob.e.keller@intel.com>", "To": "Intel Wired LAN <intel-wired-lan@lists.osuosl.org>", "Date": "Tue, 7 Jun 2016 16:08:47 -0700", "Message-Id": "<20160607230902.5457-4-jacob.e.keller@intel.com>", "X-Mailer": "git-send-email 2.9.0.rc1.405.g81f467e", "In-Reply-To": "<20160607230902.5457-1-jacob.e.keller@intel.com>", "References": "<20160607230902.5457-1-jacob.e.keller@intel.com>", "Subject": "[Intel-wired-lan] [PATCH v2 03/18] fm10k: don't stop reset due to\n\tFM10K_ERR_REQUESTS_PENDING", "X-BeenThere": "intel-wired-lan@lists.osuosl.org", "X-Mailman-Version": "2.1.18-1", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>", "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>", "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.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@lists.osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>" }, "content": "Don't report FM10K_ERR_REQUESTS_PENDING when we fail to disable queues\nwithin the timeout. This can occur due to a hardware Tx hang, or when\nthe switch ethernet fabric is resetting while we are transmitting\ntraffic. It can sometimes take up to 500ms before the Tx DMA engine\ngives up. Instead, just skip the DMA engine check and perform\na data-path reset anyways. Add a statistic counter to keep track of the\nnumber of resets occurring while we have pending DMA on the rings.\n\nIn order to prevent having to re-assign err to 0, re-order the\nlast few items of the reset_hw_pf function so that we don't perform\n\"return err\" at the end.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c | 2 ++\n drivers/net/ethernet/intel/fm10k/fm10k_pf.c | 24 ++++++++++++++----------\n drivers/net/ethernet/intel/fm10k/fm10k_type.h | 1 +\n drivers/net/ethernet/intel/fm10k/fm10k_vf.c | 12 +++++++-----\n 4 files changed, 24 insertions(+), 15 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c\nindex 9b5195435c87..c04cbe9c9f7c 100644\n--- a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c\n+++ b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c\n@@ -76,6 +76,8 @@ static const struct fm10k_stats fm10k_gstrings_global_stats[] = {\n \tFM10K_STAT(\"mac_rules_used\", hw.swapi.mac.used),\n \tFM10K_STAT(\"mac_rules_avail\", hw.swapi.mac.avail),\n \n+\tFM10K_STAT(\"reset_while_pending\", hw.mac.reset_while_pending),\n+\n \tFM10K_STAT(\"tx_hang_count\", tx_timeout_count),\n };\n \ndiff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pf.c b/drivers/net/ethernet/intel/fm10k/fm10k_pf.c\nindex 69e2c822db00..7fbd94ba6745 100644\n--- a/drivers/net/ethernet/intel/fm10k/fm10k_pf.c\n+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pf.c\n@@ -51,8 +51,12 @@ static s32 fm10k_reset_hw_pf(struct fm10k_hw *hw)\n \n \t/* shut down all rings */\n \terr = fm10k_disable_queues_generic(hw, FM10K_MAX_QUEUES);\n-\tif (err)\n+\tif (err == FM10K_ERR_REQUESTS_PENDING) {\n+\t\thw->mac.reset_while_pending++;\n+\t\tgoto force_reset;\n+\t} else if (err) {\n \t\treturn err;\n+\t}\n \n \t/* Verify that DMA is no longer active */\n \treg = fm10k_read_reg(hw, FM10K_DMA_CTRL);\n@@ -62,27 +66,27 @@ static s32 fm10k_reset_hw_pf(struct fm10k_hw *hw)\n \t/* verify the switch is ready for reset */\n \treg = fm10k_read_reg(hw, FM10K_DMA_CTRL2);\n \tif (!(reg & FM10K_DMA_CTRL2_SWITCH_READY))\n-\t\tgoto out;\n+\t\treturn FM10K_ERR_DMA_PENDING;\n \n+force_reset:\n \t/* Inititate data path reset */\n-\treg |= FM10K_DMA_CTRL_DATAPATH_RESET;\n+\treg = FM10K_DMA_CTRL_DATAPATH_RESET;\n \tfm10k_write_reg(hw, FM10K_DMA_CTRL, reg);\n \n \t/* Flush write and allow 100us for reset to complete */\n \tfm10k_write_flush(hw);\n \tudelay(FM10K_RESET_TIMEOUT);\n \n-\t/* Verify we made it out of reset */\n-\treg = fm10k_read_reg(hw, FM10K_IP);\n-\tif (!(reg & FM10K_IP_NOTINRESET))\n-\t\terr = FM10K_ERR_RESET_FAILED;\n-\n \t/* Reset mailbox global interrupts */\n \treg = FM10K_MBX_GLOBAL_REQ_INTERRUPT | FM10K_MBX_GLOBAL_ACK_INTERRUPT;\n \tfm10k_write_reg(hw, FM10K_GMBX, reg);\n \n-out:\n-\treturn err;\n+\t/* Verify we made it out of reset */\n+\treg = fm10k_read_reg(hw, FM10K_IP);\n+\tif (!(reg & FM10K_IP_NOTINRESET))\n+\t\treturn FM10K_ERR_RESET_FAILED;\n+\n+\treturn 0;\n }\n \n /**\ndiff --git a/drivers/net/ethernet/intel/fm10k/fm10k_type.h b/drivers/net/ethernet/intel/fm10k/fm10k_type.h\nindex b8bc06183720..1d65ad85d72e 100644\n--- a/drivers/net/ethernet/intel/fm10k/fm10k_type.h\n+++ b/drivers/net/ethernet/intel/fm10k/fm10k_type.h\n@@ -562,6 +562,7 @@ struct fm10k_mac_info {\n \tbool tx_ready;\n \tu32 dglort_map;\n \tu8 itr_scale;\n+\tu64 reset_while_pending;\n };\n \n struct fm10k_swapi_table_info {\ndiff --git a/drivers/net/ethernet/intel/fm10k/fm10k_vf.c b/drivers/net/ethernet/intel/fm10k/fm10k_vf.c\nindex 3b06685ea63b..337ba65a9411 100644\n--- a/drivers/net/ethernet/intel/fm10k/fm10k_vf.c\n+++ b/drivers/net/ethernet/intel/fm10k/fm10k_vf.c\n@@ -34,7 +34,7 @@ static s32 fm10k_stop_hw_vf(struct fm10k_hw *hw)\n \n \t/* we need to disable the queues before taking further steps */\n \terr = fm10k_stop_hw_generic(hw);\n-\tif (err)\n+\tif (err && err != FM10K_ERR_REQUESTS_PENDING)\n \t\treturn err;\n \n \t/* If permanent address is set then we need to restore it */\n@@ -67,7 +67,7 @@ static s32 fm10k_stop_hw_vf(struct fm10k_hw *hw)\n \t\tfm10k_write_reg(hw, FM10K_TDLEN(i), tdlen);\n \t}\n \n-\treturn 0;\n+\treturn err;\n }\n \n /**\n@@ -83,7 +83,9 @@ static s32 fm10k_reset_hw_vf(struct fm10k_hw *hw)\n \n \t/* shut down queues we own and reset DMA configuration */\n \terr = fm10k_stop_hw_vf(hw);\n-\tif (err)\n+\tif (err == FM10K_ERR_REQUESTS_PENDING)\n+\t\thw->mac.reset_while_pending++;\n+\telse if (err)\n \t\treturn err;\n \n \t/* Inititate VF reset */\n@@ -96,9 +98,9 @@ static s32 fm10k_reset_hw_vf(struct fm10k_hw *hw)\n \t/* Clear reset bit and verify it was cleared */\n \tfm10k_write_reg(hw, FM10K_VFCTRL, 0);\n \tif (fm10k_read_reg(hw, FM10K_VFCTRL) & FM10K_VFCTRL_RST)\n-\t\terr = FM10K_ERR_RESET_FAILED;\n+\t\treturn FM10K_ERR_RESET_FAILED;\n \n-\treturn err;\n+\treturn 0;\n }\n \n /**\n", "prefixes": [ "v2", "03/18" ] }