Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/872428/?format=api
{ "id": 872428, "url": "http://patchwork.ozlabs.org/api/patches/872428/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180212141659.38064-1-alice.michael@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": "<20180212141659.38064-1-alice.michael@intel.com>", "list_archive_url": null, "date": "2018-02-12T14:16:59", "name": "i40e/i40evf: use SW variables for hang detection", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "239b38973190d3344428540a4bc7b5b890490610", "submitter": { "id": 71123, "url": "http://patchwork.ozlabs.org/api/people/71123/?format=api", "name": "Michael, Alice", "email": "alice.michael@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/20180212141659.38064-1-alice.michael@intel.com/mbox/", "series": [ { "id": 28221, "url": "http://patchwork.ozlabs.org/api/series/28221/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=28221", "date": "2018-02-12T14:16:59", "name": "i40e/i40evf: use SW variables for hang detection", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/28221/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/872428/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/872428/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.133; helo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 3zgKwf2WWHz9t32\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 13 Feb 2018 09:24:49 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 87DCD88DB8;\n\tMon, 12 Feb 2018 22:24:48 +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 9rDaZluV2BCm; Mon, 12 Feb 2018 22:24:44 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id D11BB88DA6;\n\tMon, 12 Feb 2018 22:24:44 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 8A8E21C2BCD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 12 Feb 2018 22:24:43 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 86430873F8\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 12 Feb 2018 22:24:43 +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 Oesg32giygGH for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 12 Feb 2018 22:24:42 +0000 (UTC)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id C6EBE873F6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 12 Feb 2018 22:24:42 +0000 (UTC)", "from orsmga006.jf.intel.com ([10.7.209.51])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t12 Feb 2018 14:24:40 -0800", "from alicemic-2.jf.intel.com ([10.166.16.121])\n\tby orsmga006.jf.intel.com with ESMTP; 12 Feb 2018 14:24:39 -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.46,504,1511856000\"; d=\"scan'208\";a=\"17921524\"", "From": "Alice Michael <alice.michael@intel.com>", "To": "alice.michael@intel.com,\n\tintel-wired-lan@lists.osuosl.org", "Date": "Mon, 12 Feb 2018 09:16:59 -0500", "Message-Id": "<20180212141659.38064-1-alice.michael@intel.com>", "X-Mailer": "git-send-email 2.9.5", "Subject": "[Intel-wired-lan] [PATCH] i40e/i40evf: use SW variables for hang\n\tdetection", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.24", "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": "From: Alan Brady <alan.brady@intel.com>\n\nThe i40e_detect_recover_hung function uses the i40e_get_tx_pending\nfunction to determine if there are packets stalled on the ring.\ni40e_get_tx_pending calculates the pending packets using the head\nwriteback value and HW tail. If the queue is stopped and we lose the\ninterrupt to update our next_to_clean then we a) won't get another\ninterrupt to clean because queue is stopped b) we won't catch the\nproblem with i40e_detect_recover_hung because the HW values look like\nthere's no packets waiting to be transmitted. Using the SW values we\ncan catch the issue because next_to_clean will be out of sync with head\nwriteback.\n\nThis has the added benefit being less CPU intensive because we don't\nneed to reach into the hardware to get the values.\n\nSigned-off-by: Alan Brady <alan.brady@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_txrx.c | 16 +++++++++++-----\n drivers/net/ethernet/intel/i40e/i40e_txrx.h | 2 +-\n drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 2 +-\n 3 files changed, 13 insertions(+), 7 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 121011e..7ccd05b 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -709,16 +709,22 @@ void i40e_free_tx_resources(struct i40e_ring *tx_ring)\n /**\n * i40e_get_tx_pending - how many tx descriptors not processed\n * @tx_ring: the ring of descriptors\n+ * @in_sw: use SW variables\n *\n * Since there is no access to the ring head register\n * in XL710, we need to use our local copies\n **/\n-u32 i40e_get_tx_pending(struct i40e_ring *ring)\n+u32 i40e_get_tx_pending(struct i40e_ring *ring, bool in_sw)\n {\n \tu32 head, tail;\n \n-\thead = i40e_get_head(ring);\n-\ttail = readl(ring->tail);\n+\tif (!in_sw) {\n+\t\thead = i40e_get_head(ring);\n+\t\ttail = readl(ring->tail);\n+\t} else {\n+\t\thead = ring->next_to_clean;\n+\t\ttail = ring->next_to_use;\n+\t}\n \n \tif (head != tail)\n \t\treturn (head < tail) ?\n@@ -775,7 +781,7 @@ void i40e_detect_recover_hung(struct i40e_vsi *vsi)\n \t\t\t */\n \t\t\tsmp_rmb();\n \t\t\ttx_ring->tx_stats.prev_pkt_ctr =\n-\t\t\t i40e_get_tx_pending(tx_ring) ? packets : -1;\n+\t\t\t i40e_get_tx_pending(tx_ring, true) ? packets : -1;\n \t\t}\n \t}\n }\n@@ -899,7 +905,7 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,\n \t\t * them to be written back in case we stay in NAPI.\n \t\t * In this mode on X722 we do not enable Interrupt.\n \t\t */\n-\t\tunsigned int j = i40e_get_tx_pending(tx_ring);\n+\t\tunsigned int j = i40e_get_tx_pending(tx_ring, false);\n \n \t\tif (budget &&\n \t\t ((j / WB_STRIDE) == 0) && (j > 0) &&\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h\nindex ea114dc..000646b5 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h\n@@ -506,7 +506,7 @@ void i40e_free_tx_resources(struct i40e_ring *tx_ring);\n void i40e_free_rx_resources(struct i40e_ring *rx_ring);\n int i40e_napi_poll(struct napi_struct *napi, int budget);\n void i40e_force_wb(struct i40e_vsi *vsi, struct i40e_q_vector *q_vector);\n-u32 i40e_get_tx_pending(struct i40e_ring *ring);\n+u32 i40e_get_tx_pending(struct i40e_ring *ring, bool in_sw);\n void i40e_detect_recover_hung(struct i40e_vsi *vsi);\n int __i40e_maybe_stop_tx(struct i40e_ring *tx_ring, int size);\n bool __i40e_chk_linearize(struct sk_buff *skb);\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\nindex d3c5263..12bd937 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n@@ -197,7 +197,7 @@ void i40evf_detect_recover_hung(struct i40e_vsi *vsi)\n \t\t\t */\n \t\t\tsmp_rmb();\n \t\t\ttx_ring->tx_stats.prev_pkt_ctr =\n-\t\t\t i40evf_get_tx_pending(tx_ring, false) ? packets : -1;\n+\t\t\t i40evf_get_tx_pending(tx_ring, true) ? packets : -1;\n \t\t}\n \t}\n }\n", "prefixes": [] }