get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/747507/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 747507,
    "url": "http://patchwork.ozlabs.org/api/patches/747507/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170405115103.67374-11-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": "<20170405115103.67374-11-alice.michael@intel.com>",
    "list_archive_url": null,
    "date": "2017-04-05T11:51:03",
    "name": "[next,S66,v2,11/11] i40e/i40evf: Use build_skb to build frames",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "ed216e2e1df4bc5dc8e83fca562f5a8f2965186f",
    "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/20170405115103.67374-11-alice.michael@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/747507/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/747507/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 3vyxP61S9Xz9s8c\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  6 Apr 2017 05:54:02 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 8FC1D862F3;\n\tWed,  5 Apr 2017 19:54:00 +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 wNiNMGG2UvsQ; Wed,  5 Apr 2017 19:53:56 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 1A4DD8642A;\n\tWed,  5 Apr 2017 19:53:52 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 2F28E1C0100\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed,  5 Apr 2017 19:53:49 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 2A82E86B9D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed,  5 Apr 2017 19:53:49 +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 h74B4NxgDxW4 for <intel-wired-lan@lists.osuosl.org>;\n\tWed,  5 Apr 2017 19:53:48 +0000 (UTC)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 039F386BF2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed,  5 Apr 2017 19:53:47 +0000 (UTC)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t05 Apr 2017 12:53:47 -0700",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.16.121])\n\tby orsmga003.jf.intel.com with ESMTP; 05 Apr 2017 12:53:47 -0700"
        ],
        "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"key not found in DNS\" (0-bit key;\n\tunprotected) header.d=intel.com header.i=@intel.com\n\theader.b=\"Acdygpys\"; 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=simple/simple;\n\td=intel.com; i=@intel.com; q=dns/txt; s=intel;\n\tt=1491422027; x=1522958027;\n\th=from:to:cc:subject:date:message-id:in-reply-to: references;\n\tbh=KOFBcMzzIjPUmyuuMRhSGlp+z8ZznmmqzAbR4OfbntA=;\n\tb=AcdygpysWaIPoybnkFKrwSW3Bb3xD8/Z79AnX2sPUgzIyvqcuTQG1tAU\n\tqGIrYGwd4RngN1I6VoOUTXY9Nr2qJg==;",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.37,280,1488873600\"; d=\"scan'208\";a=\"952301610\"",
        "From": "Alice Michael <alice.michael@intel.com>",
        "To": "alice.michael@intel.com,\n\tintel-wired-lan@lists.osuosl.org",
        "Date": "Wed,  5 Apr 2017 07:51:03 -0400",
        "Message-Id": "<20170405115103.67374-11-alice.michael@intel.com>",
        "X-Mailer": "git-send-email 2.9.3",
        "In-Reply-To": "<20170405115103.67374-1-alice.michael@intel.com>",
        "References": "<20170405115103.67374-1-alice.michael@intel.com>",
        "Subject": "[Intel-wired-lan] [next S66 v2 11/11] i40e/i40evf: Use build_skb to\n\tbuild frames",
        "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: Alexander Duyck <alexander.h.duyck@intel.com>\n\nThis patch is meant to improve the performance of the Rx path.\nSpecifically by using build_skb we have several distinct advantages.\n\nIn the case of small frames we were previously using a copy-break approach.\nThis means that we were allocating a page fragment to use for skb->head,\nand were having to copy the packet into that region.  Both of those calls\nare now avoided since we just build the skb around the data.\n\nIn the case of large frames the gains are much more significant.\nSpecifically we were having to allocate skb->head, and copy the headers as\nbefore.  However in addition we were having to parse the header using\neth_get_headlen which could be quite expensive.  All of this is avoided by\nbuilding the frame around the data.  I have seen gains as high as 30% when\nusing VXLAN for instance due to just header pulling overhead.\n\nFinally with all this in place it also sets us up to start looking at\nenabling XDP.  Specifically we now have a path in which the data is in the\npage and the frame is built around it.  So if we parse it with XDP before\nwe call build_skb we can take care of any necessary processing there.\n\nSigned-off-by: Alexander Duyck <alexander.h.duyck@intel.com>\nChange-ID: Id4bdd618e94473d41f892417e5d8019639e421e3\n---\n drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 47 +++++++++++++++++++++++++++\n drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 47 +++++++++++++++++++++++++++\n 2 files changed, 94 insertions(+)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 4b31aec..b4a7bfc 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -1816,6 +1816,51 @@ static struct sk_buff *i40e_construct_skb(struct i40e_ring *rx_ring,\n }\n \n /**\n+ * i40e_build_skb - Build skb around an existing buffer\n+ * @rx_ring: rx descriptor ring to transact packets on\n+ * @rx_buffer: rx buffer to pull data from\n+ * @size: size of buffer to add to skb\n+ *\n+ * This function builds an skb around an existing Rx buffer, taking care\n+ * to set up the skb correctly and avoid any memcpy overhead.\n+ */\n+static struct sk_buff *i40e_build_skb(struct i40e_ring *rx_ring,\n+\t\t\t\t      struct i40e_rx_buffer *rx_buffer,\n+\t\t\t\t      unsigned int size)\n+{\n+\tvoid *va = page_address(rx_buffer->page) + rx_buffer->page_offset;\n+#if (PAGE_SIZE < 8192)\n+\tunsigned int truesize = i40e_rx_pg_size(rx_ring) / 2;\n+#else\n+\tunsigned int truesize = SKB_DATA_ALIGN(size);\n+#endif\n+\tstruct sk_buff *skb;\n+\n+\t/* prefetch first cache line of first page */\n+\tprefetch(va);\n+#if L1_CACHE_BYTES < 128\n+\tprefetch(va + L1_CACHE_BYTES);\n+#endif\n+\t/* build an skb around the page buffer */\n+\tskb = build_skb(va - I40E_SKB_PAD, truesize);\n+\tif (unlikely(!skb))\n+\t\treturn NULL;\n+\n+\t/* update pointers within the skb to store the data */\n+\tskb_reserve(skb, I40E_SKB_PAD);\n+\t__skb_put(skb, size);\n+\n+\t/* buffer is used by skb, update page_offset */\n+#if (PAGE_SIZE < 8192)\n+\trx_buffer->page_offset ^= truesize;\n+#else\n+\trx_buffer->page_offset += truesize;\n+#endif\n+\n+\treturn skb;\n+}\n+\n+/**\n  * i40e_put_rx_buffer - Clean up used buffer and either recycle or free\n  * @rx_ring: rx descriptor ring to transact packets on\n  * @rx_buffer: rx buffer to pull data from\n@@ -1939,6 +1984,8 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \t\t/* retrieve a buffer from the ring */\n \t\tif (skb)\n \t\t\ti40e_add_rx_frag(rx_ring, rx_buffer, skb, size);\n+\t\telse if (ring_uses_build_skb(rx_ring))\n+\t\t\tskb = i40e_build_skb(rx_ring, rx_buffer, size);\n \t\telse\n \t\t\tskb = i40e_construct_skb(rx_ring, rx_buffer, size);\n \ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\nindex d96f10a..7f1341c 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n@@ -1177,6 +1177,51 @@ static struct sk_buff *i40e_construct_skb(struct i40e_ring *rx_ring,\n }\n \n /**\n+ * i40e_build_skb - Build skb around an existing buffer\n+ * @rx_ring: rx descriptor ring to transact packets on\n+ * @rx_buffer: rx buffer to pull data from\n+ * @size: size of buffer to add to skb\n+ *\n+ * This function builds an skb around an existing Rx buffer, taking care\n+ * to set up the skb correctly and avoid any memcpy overhead.\n+ */\n+static struct sk_buff *i40e_build_skb(struct i40e_ring *rx_ring,\n+\t\t\t\t      struct i40e_rx_buffer *rx_buffer,\n+\t\t\t\t      unsigned int size)\n+{\n+\tvoid *va = page_address(rx_buffer->page) + rx_buffer->page_offset;\n+#if (PAGE_SIZE < 8192)\n+\tunsigned int truesize = i40e_rx_pg_size(rx_ring) / 2;\n+#else\n+\tunsigned int truesize = SKB_DATA_ALIGN(size);\n+#endif\n+\tstruct sk_buff *skb;\n+\n+\t/* prefetch first cache line of first page */\n+\tprefetch(va);\n+#if L1_CACHE_BYTES < 128\n+\tprefetch(va + L1_CACHE_BYTES);\n+#endif\n+\t/* build an skb around the page buffer */\n+\tskb = build_skb(va - I40E_SKB_PAD, truesize);\n+\tif (unlikely(!skb))\n+\t\treturn NULL;\n+\n+\t/* update pointers within the skb to store the data */\n+\tskb_reserve(skb, I40E_SKB_PAD);\n+\t__skb_put(skb, size);\n+\n+\t/* buffer is used by skb, update page_offset */\n+#if (PAGE_SIZE < 8192)\n+\trx_buffer->page_offset ^= truesize;\n+#else\n+\trx_buffer->page_offset += truesize;\n+#endif\n+\n+\treturn skb;\n+}\n+\n+/**\n  * i40e_put_rx_buffer - Clean up used buffer and either recycle or free\n  * @rx_ring: rx descriptor ring to transact packets on\n  * @rx_buffer: rx buffer to pull data from\n@@ -1295,6 +1340,8 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \t\t/* retrieve a buffer from the ring */\n \t\tif (skb)\n \t\t\ti40e_add_rx_frag(rx_ring, rx_buffer, skb, size);\n+\t\telse if (ring_uses_build_skb(rx_ring))\n+\t\t\tskb = i40e_build_skb(rx_ring, rx_buffer, size);\n \t\telse\n \t\t\tskb = i40e_construct_skb(rx_ring, rx_buffer, size);\n \n",
    "prefixes": [
        "next",
        "S66",
        "v2",
        "11/11"
    ]
}