Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/716295/?format=api
{ "id": 716295, "url": "http://patchwork.ozlabs.org/api/patches/716295/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170117163600.5423.48511.stgit@localhost.localdomain/", "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": "<20170117163600.5423.48511.stgit@localhost.localdomain>", "list_archive_url": null, "date": "2017-01-17T16:36:03", "name": "[next,v2,04/11] ixgbe: Update code to better handle incrementing page count", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "c92fa050486474399759cbb3320291f4ffc3fe45", "submitter": { "id": 252, "url": "http://patchwork.ozlabs.org/api/people/252/?format=api", "name": "Alexander Duyck", "email": "alexander.duyck@gmail.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/20170117163600.5423.48511.stgit@localhost.localdomain/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/716295/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/716295/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 3v2whq3dtZz9ryk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 18 Jan 2017 03:36:11 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id C3C3788FB1;\n\tTue, 17 Jan 2017 16:36:09 +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 s850iIXuFt8a; Tue, 17 Jan 2017 16:36:07 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 15978891F4;\n\tTue, 17 Jan 2017 16:36:07 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id A7B891C0306\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 17 Jan 2017 16:36:05 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id A387030261\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 17 Jan 2017 16:36:05 +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 J5daBUsro+fQ for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 17 Jan 2017 16:36:05 +0000 (UTC)", "from mail-pf0-f193.google.com (mail-pf0-f193.google.com\n\t[209.85.192.193])\n\tby silver.osuosl.org (Postfix) with ESMTPS id E88BB3023B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 17 Jan 2017 16:36:04 +0000 (UTC)", "by mail-pf0-f193.google.com with SMTP id f144so16572761pfa.2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 17 Jan 2017 08:36:04 -0800 (PST)", "from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0])\n\tby smtp.gmail.com with ESMTPSA id\n\ts17sm57404168pgo.27.2017.01.17.08.36.03\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 17 Jan 2017 08:36:04 -0800 (PST)" ], "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"Ud9DunQH\"; dkim-atps=neutral", "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=subject:from:to:date:message-id:in-reply-to:references:user-agent\n\t:mime-version:content-transfer-encoding;\n\tbh=DQV0+idSYaBMLruwSizP6+QPuau0vXcf2wqnIN1gIdg=;\n\tb=Ud9DunQH+X2pxYqkmpuxyAPqYU2ci4FACluvfA/JL/LaH/osC1UV873H5yETZMX+b5\n\twDik4xPj+7594FxOOeuyuf50dU9B92bpHTDfeLmpJnkOBr5BWU4brX6Wz3ieUr1vL2fk\n\tZFo6MjbH71iVfXUU9yMw4F41PWclK1SWkTYgpR9FVb4AQVTJWM+35fWlRwLTk2TIUPql\n\tN45OWItQjwI66LgSX7OJ3fbkT1OBI4TKxQweDglYqrHg0leCn+rnuio+9INc8kd84pOm\n\tUhGjz2rv0RmmIyi3i/uNkhN6ux+UUay2fVCs1EsNJTbdAxaTEMgHoWDfOg4kRFs3c4eP\n\tLfcQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:from:to:date:message-id:in-reply-to\n\t:references:user-agent:mime-version:content-transfer-encoding;\n\tbh=DQV0+idSYaBMLruwSizP6+QPuau0vXcf2wqnIN1gIdg=;\n\tb=Mpj4VK0UOR3Gd9c1do0gPJJxah5oMdl5w8uQKmZfHtBpgLbiAqKZA9ZCJWUMrDA3WV\n\ttDKZodrXvxwyNi3eb9fMglOy8caHx96lWwTprCMXcJd+N1JYa8mU7Oihojq5v/Efsvkl\n\t7bdV/JeeUHT5Qwz4wFG2UlCL8Lg2HU4pU2Bh/0BQ9KiD6I29FpVi8kOf+ZZTNddnZmSG\n\tOaUmCyrWYZLEqBi4ERRI9pAmy7cZy8qRzTkQwU8fsovHTMjXtgIw+3m7S2wi00/Z5zWX\n\t7VeVfnbHEx4rhvX2/yIb12285dyQ9GUG32nb6wggYA8qjBGdt8m4fxVCQ/CABrI/dlDQ\n\tQnJQ==", "X-Gm-Message-State": "AIkVDXKPUKa++dGrUUXKveMAnGkR9feA9yFi5dVDJ0v7nAcWkWXdXyUSHl7/k9FA0PueqQ==", "X-Received": "by 10.84.236.4 with SMTP id q4mr54316388plk.110.1484670964632;\n\tTue, 17 Jan 2017 08:36:04 -0800 (PST)", "From": "Alexander Duyck <alexander.duyck@gmail.com>", "To": "intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com", "Date": "Tue, 17 Jan 2017 08:36:03 -0800", "Message-ID": "<20170117163600.5423.48511.stgit@localhost.localdomain>", "In-Reply-To": "<20170117163401.5423.37993.stgit@localhost.localdomain>", "References": "<20170117163401.5423.37993.stgit@localhost.localdomain>", "User-Agent": "StGit/0.17.1-dirty", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [next PATCH v2 04/11] ixgbe: Update code to\n\tbetter handle incrementing page count", "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>", "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: Alexander Duyck <alexander.h.duyck@intel.com>\n\nBatch the page count updates instead of doing them one at a time. By doing\nthis we can improve the overall performance as the atomic increment\noperations can be expensive due to the fact that on x86 they are locked\noperations which can cause stalls. By doing bulk updates we can\nconsolidate the stall which should help to improve the overall receive\nperformance.\n\nSigned-off-by: Alexander Duyck <alexander.h.duyck@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe.h | 7 ++++\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 39 ++++++++++++++++---------\n 2 files changed, 31 insertions(+), 15 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\nindex 97e74deecae2..717c65b0deb2 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n@@ -198,7 +198,12 @@ struct ixgbe_rx_buffer {\n \tstruct sk_buff *skb;\n \tdma_addr_t dma;\n \tstruct page *page;\n-\tunsigned int page_offset;\n+#if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536)\n+\t__u32 page_offset;\n+#else\n+\t__u16 page_offset;\n+#endif\n+\t__u16 pagecnt_bias;\n };\n \n struct ixgbe_queue_stats {\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 8ee8fcf0fe21..34a5271a7b35 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -1602,6 +1602,7 @@ static bool ixgbe_alloc_mapped_page(struct ixgbe_ring *rx_ring,\n \tbi->dma = dma;\n \tbi->page = page;\n \tbi->page_offset = 0;\n+\tbi->pagecnt_bias = 1;\n \n \treturn true;\n }\n@@ -1960,13 +1961,15 @@ static bool ixgbe_can_reuse_rx_page(struct ixgbe_ring *rx_ring,\n \tunsigned int last_offset = ixgbe_rx_pg_size(rx_ring) -\n \t\t\t\t ixgbe_rx_bufsz(rx_ring);\n #endif\n+\tunsigned int pagecnt_bias = rx_buffer->pagecnt_bias--;\n+\n \t/* avoid re-using remote pages */\n \tif (unlikely(ixgbe_page_is_reserved(page)))\n \t\treturn false;\n \n #if (PAGE_SIZE < 8192)\n \t/* if we are only owner of page we can reuse it */\n-\tif (unlikely(page_count(page) != 1))\n+\tif (unlikely(page_count(page) != pagecnt_bias))\n \t\treturn false;\n \n \t/* flip page offset to other buffer */\n@@ -1979,10 +1982,14 @@ static bool ixgbe_can_reuse_rx_page(struct ixgbe_ring *rx_ring,\n \t\treturn false;\n #endif\n \n-\t/* Even if we own the page, we are not allowed to use atomic_set()\n-\t * This would break get_page_unless_zero() users.\n+\t/* If we have drained the page fragment pool we need to update\n+\t * the pagecnt_bias and page count so that we fully restock the\n+\t * number of references the driver holds.\n \t */\n-\tpage_ref_inc(page);\n+\tif (unlikely(pagecnt_bias == 1)) {\n+\t\tpage_ref_add(page, USHRT_MAX);\n+\t\trx_buffer->pagecnt_bias = USHRT_MAX;\n+\t}\n \n \treturn true;\n }\n@@ -2026,7 +2033,6 @@ static bool ixgbe_add_rx_frag(struct ixgbe_ring *rx_ring,\n \t\t\treturn true;\n \n \t\t/* this page cannot be reused so discard it */\n-\t\t__free_pages(page, ixgbe_rx_pg_order(rx_ring));\n \t\treturn false;\n \t}\n \n@@ -2105,15 +2111,19 @@ static struct sk_buff *ixgbe_fetch_rx_buffer(struct ixgbe_ring *rx_ring,\n \tif (ixgbe_add_rx_frag(rx_ring, rx_buffer, size, skb)) {\n \t\t/* hand second half of page back to the ring */\n \t\tixgbe_reuse_rx_page(rx_ring, rx_buffer);\n-\t} else if (IXGBE_CB(skb)->dma == rx_buffer->dma) {\n-\t\t/* the page has been released from the ring */\n-\t\tIXGBE_CB(skb)->page_released = true;\n \t} else {\n-\t\t/* we are not reusing the buffer so unmap it */\n-\t\tdma_unmap_page_attrs(rx_ring->dev, rx_buffer->dma,\n-\t\t\t\t ixgbe_rx_pg_size(rx_ring),\n-\t\t\t\t DMA_FROM_DEVICE,\n-\t\t\t\t IXGBE_RX_DMA_ATTR);\n+\t\tif (IXGBE_CB(skb)->dma == rx_buffer->dma) {\n+\t\t\t/* the page has been released from the ring */\n+\t\t\tIXGBE_CB(skb)->page_released = true;\n+\t\t} else {\n+\t\t\t/* we are not reusing the buffer so unmap it */\n+\t\t\tdma_unmap_page_attrs(rx_ring->dev, rx_buffer->dma,\n+\t\t\t\t\t ixgbe_rx_pg_size(rx_ring),\n+\t\t\t\t\t DMA_FROM_DEVICE,\n+\t\t\t\t\t IXGBE_RX_DMA_ATTR);\n+\t\t}\n+\t\t__page_frag_cache_drain(page,\n+\t\t\t\t\trx_buffer->pagecnt_bias);\n \t}\n \n \t/* clear contents of buffer_info */\n@@ -4973,7 +4983,8 @@ static void ixgbe_clean_rx_ring(struct ixgbe_ring *rx_ring)\n \t\t\t\t ixgbe_rx_pg_size(rx_ring),\n \t\t\t\t DMA_FROM_DEVICE,\n \t\t\t\t IXGBE_RX_DMA_ATTR);\n-\t\t__free_pages(rx_buffer->page, ixgbe_rx_pg_order(rx_ring));\n+\t\t__page_frag_cache_drain(rx_buffer->page,\n+\t\t\t\t\trx_buffer->pagecnt_bias);\n \n \t\trx_buffer->page = NULL;\n \t}\n", "prefixes": [ "next", "v2", "04/11" ] }