Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/792260/?format=api
{ "id": 792260, "url": "http://patchwork.ozlabs.org/api/patches/792260/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170721183627.13373-5-bpoirier@suse.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": "<20170721183627.13373-5-bpoirier@suse.com>", "list_archive_url": null, "date": "2017-07-21T18:36:27", "name": "[5/5] e1000e: Avoid receiver overrun interrupt bursts", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "e6aefcbe2e3700ff0aeb10813569726f0ee51a48", "submitter": { "id": 67008, "url": "http://patchwork.ozlabs.org/api/people/67008/?format=api", "name": "Benjamin Poirier", "email": "bpoirier@suse.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/20170721183627.13373-5-bpoirier@suse.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/792260/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/792260/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>)", "Received": [ "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\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 3xDfcx0WgTz9s7g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 22 Jul 2017 04:37:04 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 6E23187B4A;\n\tFri, 21 Jul 2017 18:37:03 +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 tC1HCXkkZ_2s; Fri, 21 Jul 2017 18:37:02 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 6BA0987F1A;\n\tFri, 21 Jul 2017 18:37:02 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id CB1171C0964\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 21 Jul 2017 18:37:00 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id C43ED8A2DD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 21 Jul 2017 18:37: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 y6gygOVKJIIz for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 21 Jul 2017 18:37:00 +0000 (UTC)", "from mx1.suse.de (mx2.suse.de [195.135.220.15])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id B55928A1FA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 21 Jul 2017 18:36:59 +0000 (UTC)", "from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])\n\tby mx1.suse.de (Postfix) with ESMTP id 4272CABC3;\n\tFri, 21 Jul 2017 18:36:58 +0000 (UTC)" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org", "by amavisd-new at test-mx.suse.de" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "From": "Benjamin Poirier <bpoirier@suse.com>", "To": "Jeff Kirsher <jeffrey.t.kirsher@intel.com>", "Date": "Fri, 21 Jul 2017 11:36:27 -0700", "Message-Id": "<20170721183627.13373-5-bpoirier@suse.com>", "X-Mailer": "git-send-email 2.13.2", "In-Reply-To": "<20170721183627.13373-1-bpoirier@suse.com>", "References": "<20170721160937.GA22632@csclub.uwaterloo.ca>\n\t<20170721183627.13373-1-bpoirier@suse.com>", "Cc": "netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org,\n\tlinux-kernel@vger.kernel.org,\n\tLennart Sorensen <lsorense@csclub.uwaterloo.ca>", "Subject": "[Intel-wired-lan] [PATCH 5/5] e1000e: Avoid receiver overrun\n\tinterrupt bursts", "X-BeenThere": "intel-wired-lan@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.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": "When e1000e_poll() is not fast enough to keep up with incoming traffic, the\nadapter (when operating in msix mode) raises the Other interrupt to signal\nReceiver Overrun.\n\nThis is a double problem because 1) at the moment e1000_msix_other()\nassumes that it is only called in case of Link Status Change and 2) if the\ncondition persists, the interrupt is repeatedly raised again in quick\nsuccession.\n\nIdeally we would configure the Other interrupt to not be raised in case of\nreceiver overrun but this doesn't seem possible on this adapter. Instead,\nwe handle the first part of the problem by reverting to the practice of\nreading ICR in the other interrupt handler, like before commit 16ecba59bc33\n(\"e1000e: Do not read ICR in Other interrupt\"). Thanks to commit\n0a8047ac68e5 (\"e1000e: Fix msi-x interrupt automask\") which cleared IAME\nfrom CTRL_EXT, reading ICR doesn't interfere with RxQ0, TxQ0 interrupts\nanymore. We handle the second part of the problem by not re-enabling the\nOther interrupt right away when there is overrun. Instead, we wait until\ntraffic subsides, napi polling mode is exited and interrupts are\nre-enabled.\n\nReported-by: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>\nFixes: 16ecba59bc33 (\"e1000e: Do not read ICR in Other interrupt\")\nSigned-off-by: Benjamin Poirier <bpoirier@suse.com>\n---\n drivers/net/ethernet/intel/e1000e/defines.h | 1 +\n drivers/net/ethernet/intel/e1000e/netdev.c | 33 +++++++++++++++++++++++------\n 2 files changed, 27 insertions(+), 7 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/e1000e/defines.h b/drivers/net/ethernet/intel/e1000e/defines.h\nindex 0641c0098738..afb7ebe20b24 100644\n--- a/drivers/net/ethernet/intel/e1000e/defines.h\n+++ b/drivers/net/ethernet/intel/e1000e/defines.h\n@@ -398,6 +398,7 @@\n #define E1000_ICR_LSC 0x00000004 /* Link Status Change */\n #define E1000_ICR_RXSEQ 0x00000008 /* Rx sequence error */\n #define E1000_ICR_RXDMT0 0x00000010 /* Rx desc min. threshold (0) */\n+#define E1000_ICR_RXO 0x00000040 /* Receiver Overrun */\n #define E1000_ICR_RXT0 0x00000080 /* Rx timer intr (ring 0) */\n #define E1000_ICR_ECCER 0x00400000 /* Uncorrectable ECC Error */\n /* If this bit asserted, the driver should claim the interrupt */\ndiff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c\nindex 5a8ab1136566..803edd1a6401 100644\n--- a/drivers/net/ethernet/intel/e1000e/netdev.c\n+++ b/drivers/net/ethernet/intel/e1000e/netdev.c\n@@ -1910,12 +1910,30 @@ static irqreturn_t e1000_msix_other(int __always_unused irq, void *data)\n \tstruct net_device *netdev = data;\n \tstruct e1000_adapter *adapter = netdev_priv(netdev);\n \tstruct e1000_hw *hw = &adapter->hw;\n+\tu32 icr;\n+\tbool enable = true;\n+\n+\ticr = er32(ICR);\n+\tif (icr & E1000_ICR_RXO) {\n+\t\tew32(ICR, E1000_ICR_RXO);\n+\t\tenable = false;\n+\t\t/* napi poll will re-enable Other, make sure it runs */\n+\t\tif (napi_schedule_prep(&adapter->napi)) {\n+\t\t\tadapter->total_rx_bytes = 0;\n+\t\t\tadapter->total_rx_packets = 0;\n+\t\t\t__napi_schedule(&adapter->napi);\n+\t\t}\n+\t}\n+\tif (icr & E1000_ICR_LSC) {\n+\t\tew32(ICR, E1000_ICR_LSC);\n+\t\thw->mac.get_link_status = true;\n+\t\t/* guard against interrupt when we're going down */\n+\t\tif (!test_bit(__E1000_DOWN, &adapter->state)) {\n+\t\t\tmod_timer(&adapter->watchdog_timer, jiffies + 1);\n+\t\t}\n+\t}\n \n-\thw->mac.get_link_status = true;\n-\n-\t/* guard against interrupt when we're going down */\n-\tif (!test_bit(__E1000_DOWN, &adapter->state)) {\n-\t\tmod_timer(&adapter->watchdog_timer, jiffies + 1);\n+\tif (enable && !test_bit(__E1000_DOWN, &adapter->state)) {\n \t\tew32(IMS, E1000_IMS_OTHER);\n \t}\n \n@@ -2687,7 +2705,8 @@ static int e1000e_poll(struct napi_struct *napi, int weight)\n \t\tnapi_complete_done(napi, work_done);\n \t\tif (!test_bit(__E1000_DOWN, &adapter->state)) {\n \t\t\tif (adapter->msix_entries)\n-\t\t\t\tew32(IMS, adapter->rx_ring->ims_val);\n+\t\t\t\tew32(IMS, adapter->rx_ring->ims_val |\n+\t\t\t\t E1000_IMS_OTHER);\n \t\t\telse\n \t\t\t\te1000_irq_enable(adapter);\n \t\t}\n@@ -4204,7 +4223,7 @@ static void e1000e_trigger_lsc(struct e1000_adapter *adapter)\n \tstruct e1000_hw *hw = &adapter->hw;\n \n \tif (adapter->msix_entries)\n-\t\tew32(ICS, E1000_ICS_OTHER);\n+\t\tew32(ICS, E1000_ICS_LSC | E1000_ICS_OTHER);\n \telse\n \t\tew32(ICS, E1000_ICS_LSC);\n }\n", "prefixes": [ "5/5" ] }