get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 463877,
    "url": "http://patchwork.ozlabs.org/api/patches/463877/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20150423044925.18903.17284.stgit@ahduyck-vm-fedora22/",
    "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": "<20150423044925.18903.17284.stgit@ahduyck-vm-fedora22>",
    "list_archive_url": null,
    "date": "2015-04-23T04:49:25",
    "name": "[2/3] fm10k: fold fm10k_pull_tail into fm10k_add_rx_frag",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "f57def129369fb3ebae91bae9ec6006dd4ebff18",
    "submitter": {
        "id": 64958,
        "url": "http://patchwork.ozlabs.org/api/people/64958/?format=api",
        "name": "Alexander Duyck",
        "email": "alexander.h.duyck@redhat.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/20150423044925.18903.17284.stgit@ahduyck-vm-fedora22/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/463877/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/463877/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 (hemlock.osuosl.org [140.211.166.133])\n\tby ozlabs.org (Postfix) with ESMTP id B45381400B7\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 23 Apr 2015 14:49:34 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 12575953BB;\n\tThu, 23 Apr 2015 04:49:34 +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 567Ulws2YSax; Thu, 23 Apr 2015 04:49:32 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id A1F3995394;\n\tThu, 23 Apr 2015 04:49:32 +0000 (UTC)",
            "from silver.osuosl.org (silver.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 94E4C1BF863\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 23 Apr 2015 04:49:30 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 73EE92FD32\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 23 Apr 2015 04:49:30 +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 rIpH9Zw+wp3m for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 23 Apr 2015 04:49:29 +0000 (UTC)",
            "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby silver.osuosl.org (Postfix) with ESMTPS id E36A52FC39\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 23 Apr 2015 04:49:28 +0000 (UTC)",
            "from int-mx09.intmail.prod.int.phx2.redhat.com\n\t(int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])\n\tby mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3N4nR7b005018\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=FAIL); Thu, 23 Apr 2015 00:49:27 -0400",
            "from [192.168.122.149] (ovpn-112-80.phx2.redhat.com [10.3.112.80])\n\tby int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with\n\tESMTP id t3N4nPoo006043; Thu, 23 Apr 2015 00:49:26 -0400"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "From": "Alexander Duyck <alexander.h.duyck@redhat.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Wed, 22 Apr 2015 21:49:25 -0700",
        "Message-ID": "<20150423044925.18903.17284.stgit@ahduyck-vm-fedora22>",
        "In-Reply-To": "<20150423040941.18903.3545.stgit@ahduyck-vm-fedora22>",
        "References": "<20150423040941.18903.3545.stgit@ahduyck-vm-fedora22>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.68 on 10.5.11.22",
        "Subject": "[Intel-wired-lan] [PATCH 2/3] fm10k: fold fm10k_pull_tail into\n\tfm10k_add_rx_frag",
        "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": "This change folds the fm10k_pull_tail call into fm10k_add_rx_frag.  The\nadvantage to doing this is that the fragment doesn't have to be modified\nafter it is added to the skb.\n\nSigned-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>\n---\n drivers/net/ethernet/intel/fm10k/fm10k_main.c |   66 ++++++++-----------------\n 1 file changed, 20 insertions(+), 46 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c b/drivers/net/ethernet/intel/fm10k/fm10k_main.c\nindex 1b0661e3573b..4eafdad318b4 100644\n--- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c\n+++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c\n@@ -269,16 +269,19 @@ static bool fm10k_add_rx_frag(struct fm10k_rx_buffer *rx_buffer,\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->w.length);\n #if (PAGE_SIZE < 8192)\n \tunsigned int truesize = FM10K_RX_BUFSZ;\n #else\n-\tunsigned int truesize = ALIGN(size, L1_CACHE_BYTES);\n+\tunsigned int truesize = SKB_DATA_ALIGN(size);\n #endif\n+\tunsigned int pull_len;\n \n-\tif ((size <= FM10K_RX_HDR_LEN) && !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 (likely(size <= FM10K_RX_HDR_LEN)) {\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@@ -290,8 +293,21 @@ static bool fm10k_add_rx_frag(struct fm10k_rx_buffer *rx_buffer,\n \t\treturn false;\n \t}\n \n+\t/* we need the header to contain the greater of either ETH_HLEN or\n+\t * 60 bytes if the skb->len is less than 60 for skb_pad.\n+\t */\n+\tpull_len = eth_get_headlen(va, FM10K_RX_HDR_LEN);\n+\n+\t/* align pull length to size of long to optimize memcpy performance */\n+\tmemcpy(__skb_put(skb, pull_len), va, ALIGN(pull_len, sizeof(long)));\n+\n+\t/* update all of the pointers */\n+\tva += pull_len;\n+\tsize -= pull_len;\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+\t\t\t(unsigned long)va & ~PAGE_MASK, size, truesize);\n \n \treturn fm10k_can_reuse_rx_page(rx_buffer, page, truesize);\n }\n@@ -518,44 +534,6 @@ static bool fm10k_is_non_eop(struct fm10k_ring *rx_ring,\n }\n \n /**\n- * fm10k_pull_tail - fm10k specific version of skb_pull_tail\n- * @skb: pointer to current skb being adjusted\n- *\n- * This function is an fm10k specific version of __pskb_pull_tail.  The\n- * main difference between this version and the original function is that\n- * this function can make several assumptions about the state of things\n- * that allow for significant optimizations versus the standard function.\n- * As a result we can do things like drop a frag and maintain an accurate\n- * truesize for the skb.\n- */\n-static void fm10k_pull_tail(struct sk_buff *skb)\n-{\n-\tstruct skb_frag_struct *frag = &skb_shinfo(skb)->frags[0];\n-\tunsigned char *va;\n-\tunsigned int pull_len;\n-\n-\t/* it is valid to use page_address instead of kmap since we are\n-\t * working with pages allocated out of the lomem pool per\n-\t * alloc_page(GFP_ATOMIC)\n-\t */\n-\tva = skb_frag_address(frag);\n-\n-\t/* we need the header to contain the greater of either ETH_HLEN or\n-\t * 60 bytes if the skb->len is less than 60 for skb_pad.\n-\t */\n-\tpull_len = eth_get_headlen(va, FM10K_RX_HDR_LEN);\n-\n-\t/* align pull length to size of long to optimize memcpy performance */\n-\tskb_copy_to_linear_data(skb, va, ALIGN(pull_len, sizeof(long)));\n-\n-\t/* update all of the pointers */\n-\tskb_frag_size_sub(frag, pull_len);\n-\tfrag->page_offset += pull_len;\n-\tskb->data_len -= pull_len;\n-\tskb->tail += pull_len;\n-}\n-\n-/**\n  * fm10k_cleanup_headers - Correct corrupted or empty headers\n  * @rx_ring: rx descriptor ring packet is being transacted on\n  * @rx_desc: pointer to the EOP Rx descriptor\n@@ -580,10 +558,6 @@ static bool fm10k_cleanup_headers(struct fm10k_ring *rx_ring,\n \t\treturn true;\n \t}\n \n-\t/* place header in linear portion of buffer */\n-\tif (skb_is_nonlinear(skb))\n-\t\tfm10k_pull_tail(skb);\n-\n \t/* if eth_skb_pad returns an error the skb was freed */\n \tif (eth_skb_pad(skb))\n \t\treturn true;\n",
    "prefixes": [
        "2/3"
    ]
}