Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/633391/?format=api
{ "id": 633391, "url": "http://patchwork.ozlabs.org/api/patches/633391/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160609215605.19957-1-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": "<20160609215605.19957-1-jacob.e.keller@intel.com>", "list_archive_url": null, "date": "2016-06-09T21:56:05", "name": "[v2] fm10k: use software values when checking for Tx hangs in hot path", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "9096e14f96b581eb7345031ab1f0cf7a417b776e", "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/20160609215605.19957-1-jacob.e.keller@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/633391/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/633391/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 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 3rQfJW5D73z9sBG\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 10 Jun 2016 07:56:11 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 468F3956B4;\n\tThu, 9 Jun 2016 21:56:10 +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 1V7wrLCr12N4; Thu, 9 Jun 2016 21:56:09 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id AADD89561C;\n\tThu, 9 Jun 2016 21:56:09 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 8589A1C09D6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 9 Jun 2016 21:56:08 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 7B7FE3097F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 9 Jun 2016 21:56:08 +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 kr5-tnVKbmHR for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 9 Jun 2016 21:56:07 +0000 (UTC)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby silver.osuosl.org (Postfix) with ESMTP id BBFD6307A3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 9 Jun 2016 21:56:07 +0000 (UTC)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga102.fm.intel.com with ESMTP; 09 Jun 2016 14:56:08 -0700", "from jekeller-desk.amr.corp.intel.com (HELO\n\tjekeller-desk.jekeller.internal) ([134.134.3.116])\n\tby fmsmga002.fm.intel.com with ESMTP; 09 Jun 2016 14:56:06 -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,447,1459839600\"; d=\"scan'208\";a=\"998868522\"", "From": "Jacob Keller <jacob.e.keller@intel.com>", "To": "Intel Wired LAN <intel-wired-lan@lists.osuosl.org>", "Date": "Thu, 9 Jun 2016 14:56:05 -0700", "Message-Id": "<20160609215605.19957-1-jacob.e.keller@intel.com>", "X-Mailer": "git-send-email 2.9.0.rc1.405.g81f467e", "Subject": "[Intel-wired-lan] [PATCH v2] fm10k: use software values when\n\tchecking for Tx hangs in hot path", "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": "A previous patch added support to check for hardware tx pending in the\nfm10k_down routine. This support was intended to ensure that we\naccurately check what the hardware state is. However, checking for Tx\nhangs in this manor during the hotpath results in a large performance\nhit. Avoid this by making the hotpath check use the SW counters instead.\n\nFixes: a0f53cf49cb0 (\"fm10k: use actual hardware registers when checking for pending Tx\", 2016-06-08)\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n drivers/net/ethernet/intel/fm10k/fm10k.h | 2 +-\n drivers/net/ethernet/intel/fm10k/fm10k_main.c | 19 +++++++++++++++----\n drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 2 +-\n 3 files changed, 17 insertions(+), 6 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/fm10k/fm10k.h b/drivers/net/ethernet/intel/fm10k/fm10k.h\nindex c4cf08dcf5af..75429f2bbc97 100644\n--- a/drivers/net/ethernet/intel/fm10k/fm10k.h\n+++ b/drivers/net/ethernet/intel/fm10k/fm10k.h\n@@ -458,7 +458,7 @@ __be16 fm10k_tx_encap_offload(struct sk_buff *skb);\n netdev_tx_t fm10k_xmit_frame_ring(struct sk_buff *skb,\n \t\t\t\t struct fm10k_ring *tx_ring);\n void fm10k_tx_timeout_reset(struct fm10k_intfc *interface);\n-u64 fm10k_get_tx_pending(struct fm10k_ring *ring);\n+u64 fm10k_get_tx_pending(struct fm10k_ring *ring, bool in_sw);\n bool fm10k_check_tx_hang(struct fm10k_ring *tx_ring);\n void fm10k_alloc_rx_buffers(struct fm10k_ring *rx_ring, u16 cleaned_count);\n \ndiff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c b/drivers/net/ethernet/intel/fm10k/fm10k_main.c\nindex e9767b6366a8..a4ea84273ea1 100644\n--- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c\n+++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c\n@@ -1128,13 +1128,24 @@ static u64 fm10k_get_tx_completed(struct fm10k_ring *ring)\n \treturn ring->stats.packets;\n }\n \n-u64 fm10k_get_tx_pending(struct fm10k_ring *ring)\n+/**\n+ * fm10k_get_tx_pending - how many tx descriptors not processed\n+ * @ring: the ring structure\n+ * @in_sw: is tx_pending being checked in SW or in HW?\n+ */\n+u64 fm10k_get_tx_pending(struct fm10k_ring *ring, bool in_sw)\n {\n \tstruct fm10k_intfc *interface = ring->q_vector->interface;\n \tstruct fm10k_hw *hw = &interface->hw;\n+\tu32 head, tail;\n \n-\tu32 head = fm10k_read_reg(hw, FM10K_TDH(ring->reg_idx));\n-\tu32 tail = fm10k_read_reg(hw, FM10K_TDT(ring->reg_idx));\n+\tif (likely(in_sw)) {\n+\t\thead = ring->next_to_clean;\n+\t\ttail = ring->next_to_use;\n+\t} else {\n+\t\thead = fm10k_read_reg(hw, FM10K_TDH(ring->reg_idx));\n+\t\ttail = fm10k_read_reg(hw, FM10K_TDT(ring->reg_idx));\n+\t}\n \n \treturn ((head <= tail) ? tail : tail + ring->count) - head;\n }\n@@ -1143,7 +1154,7 @@ bool fm10k_check_tx_hang(struct fm10k_ring *tx_ring)\n {\n \tu32 tx_done = fm10k_get_tx_completed(tx_ring);\n \tu32 tx_done_old = tx_ring->tx_stats.tx_done_old;\n-\tu32 tx_pending = fm10k_get_tx_pending(tx_ring);\n+\tu32 tx_pending = fm10k_get_tx_pending(tx_ring, true);\n \n \tclear_check_for_tx_hang(tx_ring);\n \ndiff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c\nindex 559cda999f49..b0c3d7b3a34c 100644\n--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c\n+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c\n@@ -1699,7 +1699,7 @@ void fm10k_down(struct fm10k_intfc *interface)\n \n \t\t/* start checking at the last ring to have pending Tx */\n \t\tfor (; i < interface->num_tx_queues; i++)\n-\t\t\tif (fm10k_get_tx_pending(interface->tx_ring[i]))\n+\t\t\tif (fm10k_get_tx_pending(interface->tx_ring[i], false))\n \t\t\t\tbreak;\n \n \t\t/* if all the queues are drained, we can break now */\n", "prefixes": [ "v2" ] }