Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/541145/?format=api
{ "id": 541145, "url": "http://patchwork.ozlabs.org/api/patches/541145/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1446852372-25480-5-git-send-email-joshua.a.hay@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": "<1446852372-25480-5-git-send-email-joshua.a.hay@intel.com>", "list_archive_url": null, "date": "2015-11-06T23:26:02", "name": "[next,S21,04/14] i40e: Detection and recovery of TX queue hung logic moved to service_task from tx_timeout", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "9b9785de1ab751e93962563c19e06fb7cef0d37c", "submitter": { "id": 19461, "url": "http://patchwork.ozlabs.org/api/people/19461/?format=api", "name": "Joshua Hay", "email": "joshua.a.hay@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/1446852372-25480-5-git-send-email-joshua.a.hay@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/541145/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/541145/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 silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ozlabs.org (Postfix) with ESMTP id A85EF1402C0\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 7 Nov 2015 10:26:22 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id F227D332A9;\n\tFri, 6 Nov 2015 23:26:21 +0000 (UTC)", "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id XICSojvVPCLx; Fri, 6 Nov 2015 23:26:20 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 4EBB033279;\n\tFri, 6 Nov 2015 23:26:20 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 8D7221C09CC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 6 Nov 2015 23:26:19 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 89D38A3EC8\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 6 Nov 2015 23:26:19 +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 aoEOt5i-p2Kg for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 6 Nov 2015 23:26:13 +0000 (UTC)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 8EE70A3ECF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 6 Nov 2015 23:26:13 +0000 (UTC)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga103.jf.intel.com with ESMTP; 06 Nov 2015 15:26:13 -0800", "from jahay1-mobl2.amr.corp.intel.com (HELO\n\tlocalhost.localdomain.localdomain) ([134.134.176.151])\n\tby FMSMGA003.fm.intel.com with ESMTP; 06 Nov 2015 15:26:13 -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-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.20,254,1444719600\"; d=\"scan'208\";a=\"595575984\"", "From": "Joshua Hay <joshua.a.hay@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Fri, 6 Nov 2015 15:26:02 -0800", "Message-Id": "<1446852372-25480-5-git-send-email-joshua.a.hay@intel.com>", "X-Mailer": "git-send-email 2.1.0", "In-Reply-To": "<1446852372-25480-1-git-send-email-joshua.a.hay@intel.com>", "References": "<1446852372-25480-1-git-send-email-joshua.a.hay@intel.com>", "Subject": "[Intel-wired-lan] [next PATCH S21 04/14] i40e: Detection and\n\trecovery of TX queue hung logic moved to service_task from\n\ttx_timeout", "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": "From: Kiran Patil <kiran.patil@intel.com>\n\nThis patch contains following changes:\n - detection and recovery logic (issue SW interrupt) has been moved to\n service_task from timeout function.\n - added some more debug info from tx_timeout.\n\nLogic to detect and recover TX queue hung is now two step process:\n - service_task detects TX queue hung and sets a bit(hung_detected) if\n it was not set.\n - if bit was set (means this is back-back hung condition detected),\n issue SW interrupt and clear the bit.\n - napi_poll clears the bit unconditionally since it cleans TX/RX queues.\n\nSigned-off-by: Kiran Patil <kiran.patil@intel.com>\nChange-ID: Ieed03a48927c845a988b3ff375090bf37caeb903\n---\n drivers/net/ethernet/intel/i40e/i40e.h | 3 +++\n drivers/net/ethernet/intel/i40e/i40e_main.c | 36 ++++++++++++++++++++++-----\n drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 ++\n drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 21 ++++++++++------\n drivers/net/ethernet/intel/i40evf/i40e_txrx.h | 15 +++++++++++\n 5 files changed, 64 insertions(+), 13 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex d854a46..768a19b 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -579,6 +579,9 @@ struct i40e_q_vector {\n \n \tu8 num_ringpairs;\t/* total number of ring pairs in vector */\n \n+#define I40E_Q_VECTOR_HUNG_DETECT 0 /* Bit Index for hung detection logic */\n+\tunsigned long hung_detected; /* Set/Reset for hung_detection logic */\n+\n \tcpumask_t affinity_mask;\n \tstruct rcu_head rcu;\t/* to avoid race with update stats on free */\n \tchar name[I40E_INT_NAME_STR_LEN];\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 7759703..d748431 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -4366,17 +4366,41 @@ static void i40e_detect_recover_hung_queue(int q_idx, struct i40e_vsi *vsi)\n \telse\n \t\tval = rd32(&pf->hw, I40E_PFINT_DYN_CTL0);\n \n+\t/* Bail out if interrupts are disabled because napi_poll\n+\t * execution in-progress or will get scheduled soon.\n+\t * napi_poll cleans TX and RX queues and updates 'next_to_clean'.\n+\t */\n+\tif (!(val & I40E_PFINT_DYN_CTLN_INTENA_MASK))\n+\t\treturn;\n+\n \thead = i40e_get_head(tx_ring);\n \n \ttx_pending = i40e_get_tx_pending(tx_ring);\n \n-\t/* Interrupts are disabled and TX pending is non-zero,\n-\t * trigger the SW interrupt (don't wait). Worst case\n-\t * there will be one extra interrupt which may result\n-\t * into not cleaning any queues because queues are cleaned.\n+\t/* HW is done executing descriptors, updated HEAD write back,\n+\t * but SW hasn't processed those descriptors. If interrupt is\n+\t * not generated from this point ON, it could result into\n+\t * dev_watchdog detecting timeout on those netdev_queue,\n+\t * hence proactively trigger SW interrupt.\n \t */\n-\tif (tx_pending && (!(val & I40E_PFINT_DYN_CTLN_INTENA_MASK)))\n-\t\ti40e_force_wb(vsi, tx_ring->q_vector);\n+\tif (tx_pending) {\n+\t\t/* NAPI Poll didn't run and clear since it was set */\n+\t\tif (test_and_clear_bit(I40E_Q_VECTOR_HUNG_DETECT,\n+\t\t\t\t &tx_ring->q_vector->hung_detected)) {\n+\t\t\tnetdev_info(vsi->netdev, \"VSI_seid %d, Hung TX queue %d, tx_pending: %d, NTC:0x%x, HWB: 0x%x, NTU: 0x%x, TAIL: 0x%x\\n\",\n+\t\t\t\t vsi->seid, q_idx, tx_pending,\n+\t\t\t\t tx_ring->next_to_clean, head,\n+\t\t\t\t tx_ring->next_to_use,\n+\t\t\t\t readl(tx_ring->tail));\n+\t\t\tnetdev_info(vsi->netdev, \"VSI_seid %d, Issuing force_wb for TX queue %d, Interrupt Reg: 0x%x\\n\",\n+\t\t\t\t vsi->seid, q_idx, val);\n+\t\t\ti40e_force_wb(vsi, tx_ring->q_vector);\n+\t\t} else {\n+\t\t\t/* First Chance - detected possible hung */\n+\t\t\tset_bit(I40E_Q_VECTOR_HUNG_DETECT,\n+\t\t\t\t&tx_ring->q_vector->hung_detected);\n+\t\t}\n+\t}\n }\n \n /**\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 494e6ef..9be0a90 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -1892,6 +1892,8 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)\n \t\treturn 0;\n \t}\n \n+\t/* Clear hung_detected bit */\n+\tclear_bit(I40E_Q_VECTOR_HUNG_DETECT, &q_vector->hung_detected);\n \t/* Since the actual Tx work is minimal, we can give the Tx a larger\n \t * budget and be more aggressive about cleaning up the Tx descriptors.\n \t */\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\nindex 3725744..3a531fe 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n@@ -127,17 +127,24 @@ void i40evf_free_tx_resources(struct i40e_ring *tx_ring)\n }\n \n /**\n- * i40e_get_head - Retrieve head from head writeback\n- * @tx_ring: tx ring to fetch head of\n+ * i40evf_get_tx_pending - how many tx descriptors not processed\n+ * @tx_ring: the ring of descriptors\n *\n- * Returns value of Tx ring head based on value stored\n- * in head write-back location\n+ * Since there is no access to the ring head register\n+ * in XL710, we need to use our local copies\n **/\n-static inline u32 i40e_get_head(struct i40e_ring *tx_ring)\n+u32 i40evf_get_tx_pending(struct i40e_ring *ring)\n {\n-\tvoid *head = (struct i40e_tx_desc *)tx_ring->desc + tx_ring->count;\n+\tu32 head, tail;\n \n-\treturn le32_to_cpu(*(volatile __le32 *)head);\n+\thead = i40e_get_head(ring);\n+\ttail = readl(ring->tail);\n+\n+\tif (head != tail)\n+\t\treturn (head < tail) ?\n+\t\t\ttail - head : (tail + ring->count - head);\n+\n+\treturn 0;\n }\n \n #define WB_STRIDE 0x3\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h\nindex 929ddd9..6640ea5 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h\n@@ -324,4 +324,19 @@ int i40evf_setup_rx_descriptors(struct i40e_ring *rx_ring);\n void i40evf_free_tx_resources(struct i40e_ring *tx_ring);\n void i40evf_free_rx_resources(struct i40e_ring *rx_ring);\n int i40evf_napi_poll(struct napi_struct *napi, int budget);\n+u32 i40evf_get_tx_pending(struct i40e_ring *ring);\n+\n+/**\n+ * i40e_get_head - Retrieve head from head writeback\n+ * @tx_ring: tx ring to fetch head of\n+ *\n+ * Returns value of Tx ring head based on value stored\n+ * in head write-back location\n+ **/\n+static inline u32 i40e_get_head(struct i40e_ring *tx_ring)\n+{\n+\tvoid *head = (struct i40e_tx_desc *)tx_ring->desc + tx_ring->count;\n+\n+\treturn le32_to_cpu(*(volatile __le32 *)head);\n+}\n #endif /* _I40E_TXRX_H_ */\n", "prefixes": [ "next", "S21", "04/14" ] }