Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/716292/?format=api
{ "id": 716292, "url": "http://patchwork.ozlabs.org/api/patches/716292/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170117163524.5423.68148.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": "<20170117163524.5423.68148.stgit@localhost.localdomain>", "list_archive_url": null, "date": "2017-01-17T16:35:34", "name": "[next,v2,01/11] ixgbe: Add function for checking to see if we can reuse page", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "9ebb11111dc0af9d8e95f33c9ae99bdc30fda751", "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/20170117163524.5423.68148.stgit@localhost.localdomain/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/716292/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/716292/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 3v2whF1hjzz9ryk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 18 Jan 2017 03:35:41 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 5C94B81447;\n\tTue, 17 Jan 2017 16:35:39 +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 TGSsT4aVrSUj; Tue, 17 Jan 2017 16:35:38 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 17E0A81658;\n\tTue, 17 Jan 2017 16:35:38 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id E6A2D1C0306\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 17 Jan 2017 16:35:36 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id E352A23244\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 17 Jan 2017 16:35:36 +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 t86A6w0mqsET for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 17 Jan 2017 16:35:36 +0000 (UTC)", "from mail-pg0-f67.google.com (mail-pg0-f67.google.com\n\t[74.125.83.67])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 397641FCFE\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 17 Jan 2017 16:35:36 +0000 (UTC)", "by mail-pg0-f67.google.com with SMTP id 75so8411885pgf.3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 17 Jan 2017 08:35:36 -0800 (PST)", "from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0])\n\tby smtp.gmail.com with ESMTPSA id\n\ti82sm8387783pfk.52.2017.01.17.08.35.34\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 17 Jan 2017 08:35:35 -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=\"tF4WFqDD\"; 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=uHzbIaYzWe2U7t+HkW1T6ADvKSkS/zyoDOxukpTefuA=;\n\tb=tF4WFqDDN3B8+V48jT+B3y4PzbPMyVLAK/11pIs8pnHIrahofhMTFa6YSqIraQItAg\n\tF8h0VLulrpBVxQ/sLnhyFp0IgCCWCCiwXvJ7fSfZForcRhvZdYCkOE/2SOs6ljalslWx\n\tGLvMpKpTnfYRpqJd+Dg/4dZvqMuaPFVORoHOLtGkc0FjayJ3q96SfVnYupQ9VRIEOw9n\n\tOusSX9iiky+mU6skvy/iDnQcp5qpkDe3Wv8a7EqCD2okrMUf5y+Lnlx5vFvi1W0gUO7J\n\tamgzWHt79mH/Igy0iVZr3eErG4aNhPHBBsk77IVvrX9mtKrH0FDjq2HZfbdcscSzknlS\n\tR3ow==", "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=uHzbIaYzWe2U7t+HkW1T6ADvKSkS/zyoDOxukpTefuA=;\n\tb=rtwUPAJyXmncghSiePA05KxVkYuUUmqs1WlpC5SFhSW072OIfbQRnS7NohYmUEFPWA\n\t/waJ9okTDdpmluNzVIXSUgsypy4Gi65af6d7wavKxYrQXc2IyiJ7jcTgnP36jFt9fIpv\n\t9IkgDLIzNU6RZr9/LCxsWqi2mPNU47/RIguwM4+jWtaxzMH+fWrgoem6geHtGnBdFCMZ\n\tnLmd2r7o4O9I4axWeYuhzMcDZACmtv8x0hpCZVgMaiLKCp3E6LAGXTXxuX/vKAm7N9j0\n\tXH/N36cRFG5aoXHMTP2/H/SlbRmpbKRHkiRnKCCbxueteTeoWGKjuNeApCDeAmpx9rXC\n\tGrmw==", "X-Gm-Message-State": "AIkVDXJN/DM4VhrK4h19abSKkVinb7du76qjFNV3DFaabeu16QGo/+gERRyRHk5qCL4sww==", "X-Received": "by 10.99.174.4 with SMTP id q4mr46449098pgf.178.1484670935605;\n\tTue, 17 Jan 2017 08:35:35 -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:35:34 -0800", "Message-ID": "<20170117163524.5423.68148.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 01/11] ixgbe: Add function for\n\tchecking to see if we can reuse page", "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\nThis patch consolidates the code for the ixgbe driver so that it is more\ninline with what is already in igb. The general idea is to just\nconsolidate functions that represent logical steps in the Rx process so we\ncan later update them more easily.\n\nSigned-off-by: Alexander Duyck <alexander.h.duyck@intel.com>\n---\n\nv2: Fix missing rx_ring parameter for PAGE_SIZE > 4K\n\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 71 +++++++++++++++----------\n 1 file changed, 42 insertions(+), 29 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 3beadc8c7a0a..452a407013ef 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -1947,6 +1947,42 @@ static inline bool ixgbe_page_is_reserved(struct page *page)\n \treturn (page_to_nid(page) != numa_mem_id()) || page_is_pfmemalloc(page);\n }\n \n+static bool ixgbe_can_reuse_rx_page(struct ixgbe_ring *rx_ring,\n+\t\t\t\t struct ixgbe_rx_buffer *rx_buffer,\n+\t\t\t\t struct page *page,\n+\t\t\t\t const unsigned int truesize)\n+{\n+#if (PAGE_SIZE >= 8192)\n+\tunsigned int last_offset = ixgbe_rx_pg_size(rx_ring) -\n+\t\t\t\t ixgbe_rx_bufsz(rx_ring);\n+#endif\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+\t\treturn false;\n+\n+\t/* flip page offset to other buffer */\n+\trx_buffer->page_offset ^= truesize;\n+#else\n+\t/* move offset up to the next cache line */\n+\trx_buffer->page_offset += truesize;\n+\n+\tif (rx_buffer->page_offset > last_offset)\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 */\n+\tpage_ref_inc(page);\n+\n+\treturn true;\n+}\n+\n /**\n * ixgbe_add_rx_frag - Add contents of Rx buffer to sk_buff\n * @rx_ring: rx descriptor ring to transact packets on\n@@ -1968,18 +2004,18 @@ static bool ixgbe_add_rx_frag(struct ixgbe_ring *rx_ring,\n \t\t\t struct sk_buff *skb)\n {\n \tstruct page *page = rx_buffer->page;\n+\tunsigned char *va = page_address(page) + rx_buffer->page_offset;\n \tunsigned int size = le16_to_cpu(rx_desc->wb.upper.length);\n #if (PAGE_SIZE < 8192)\n \tunsigned int truesize = ixgbe_rx_bufsz(rx_ring);\n #else\n \tunsigned int truesize = ALIGN(size, L1_CACHE_BYTES);\n-\tunsigned int last_offset = ixgbe_rx_pg_size(rx_ring) -\n-\t\t\t\t ixgbe_rx_bufsz(rx_ring);\n #endif\n \n-\tif ((size <= IXGBE_RX_HDR_SIZE) && !skb_is_nonlinear(skb)) {\n-\t\tunsigned char *va = page_address(page) + rx_buffer->page_offset;\n+\tif (unlikely(skb_is_nonlinear(skb)))\n+\t\tgoto add_tail_frag;\n \n+\tif (size <= IXGBE_RX_HDR_SIZE) {\n \t\tmemcpy(__skb_put(skb, size), va, ALIGN(size, sizeof(long)));\n \n \t\t/* page is not reserved, we can reuse buffer as-is */\n@@ -1991,34 +2027,11 @@ static bool ixgbe_add_rx_frag(struct ixgbe_ring *rx_ring,\n \t\treturn false;\n \t}\n \n+add_tail_frag:\n \tskb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,\n \t\t\trx_buffer->page_offset, size, truesize);\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-\t\treturn false;\n-\n-\t/* flip page offset to other buffer */\n-\trx_buffer->page_offset ^= truesize;\n-#else\n-\t/* move offset up to the next cache line */\n-\trx_buffer->page_offset += truesize;\n-\n-\tif (rx_buffer->page_offset > last_offset)\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 */\n-\tpage_ref_inc(page);\n-\n-\treturn true;\n+\treturn ixgbe_can_reuse_rx_page(rx_ring, rx_buffer, page, truesize);\n }\n \n static struct sk_buff *ixgbe_fetch_rx_buffer(struct ixgbe_ring *rx_ring,\n", "prefixes": [ "next", "v2", "01/11" ] }