get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 921389,
    "url": "http://patchwork.ozlabs.org/api/patches/921389/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180528090720.8230-1-daniel@iogearbox.net/",
    "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": "<20180528090720.8230-1-daniel@iogearbox.net>",
    "list_archive_url": null,
    "date": "2018-05-28T09:07:20",
    "name": "[net-next] bpf, i40e: add meta data support",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "fd4eaaecb6f36b5b45e42eea32b00226b92fe769",
    "submitter": {
        "id": 65705,
        "url": "http://patchwork.ozlabs.org/api/people/65705/?format=api",
        "name": "Daniel Borkmann",
        "email": "daniel@iogearbox.net"
    },
    "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/20180528090720.8230-1-daniel@iogearbox.net/mbox/",
    "series": [
        {
            "id": 46981,
            "url": "http://patchwork.ozlabs.org/api/series/46981/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=46981",
            "date": "2018-05-28T09:07:20",
            "name": "[net-next] bpf, i40e: add meta data support",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/46981/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/921389/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/921389/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@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"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.136; helo=silver.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dmarc=none (p=none dis=none)\n\theader.from=iogearbox.net"
        ],
        "Received": [
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\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 40vWht2tq7z9s0q\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 28 May 2018 19:27:09 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 75922227A5;\n\tMon, 28 May 2018 09:27: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 g7pUnCh3sJmq; Mon, 28 May 2018 09:27:06 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 86226227F1;\n\tMon, 28 May 2018 09:27:06 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id CFB2C1C0ED2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 28 May 2018 09:27:05 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id CC4A2227F5\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 28 May 2018 09:27: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 9mzdQvtW2Zng for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 28 May 2018 09:27:04 +0000 (UTC)",
            "from www62.your-server.de (www62.your-server.de [213.133.104.62])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 3F5DC227A5\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 28 May 2018 09:27:04 +0000 (UTC)",
            "from [62.202.221.10] (helo=localhost)\n\tby www62.your-server.de with esmtpsa\n\t(TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256)\n\t(Exim 4.85_2) (envelope-from <daniel@iogearbox.net>)\n\tid 1fNE7j-0000T8-Df; Mon, 28 May 2018 11:07:27 +0200"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org",
            "Clear (ClamAV 0.99.3/24610/Mon May 28 06:29:56 2018)"
        ],
        "X-Greylist": "delayed 00:19:33 by SQLgrey-1.7.6",
        "From": "Daniel Borkmann <daniel@iogearbox.net>",
        "To": "jeffrey.t.kirsher@intel.com",
        "Date": "Mon, 28 May 2018 11:07:20 +0200",
        "Message-Id": "<20180528090720.8230-1-daniel@iogearbox.net>",
        "X-Mailer": "git-send-email 2.9.5",
        "X-Authenticated-Sender": "daniel@iogearbox.net",
        "Subject": "[Intel-wired-lan] [PATCH net-next] bpf, i40e: add meta data support",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.24",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Cc": "intel-wired-lan@lists.osuosl.org, daniel@iogearbox.net",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "Add support for XDP meta data when using build skb variant of\nthe i40e driver. Implementation is analogous to the existing\nixgbe and ixgbevf support for meta data from 366a88fe2f40 (\"bpf,\nixgbe: add meta data support\") and be8333322eff (\"ixgbevf: Add\nsupport for meta data\"). With the build skb variant we get\n192 bytes of extra headroom which can be used for encaps or\nmeta data.\n\nSigned-off-by: Daniel Borkmann <daniel@iogearbox.net>\nAcked-by: John Fastabend <john.fastabend@gmail.com>\nTested-by: John Fastabend <john.fastabend@gmail.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_txrx.c | 39 +++++++++++++++++++++++------\n 1 file changed, 31 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 9b698c5..eee6e91 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -2032,6 +2032,21 @@ static struct sk_buff *i40e_construct_skb(struct i40e_ring *rx_ring,\n #if L1_CACHE_BYTES < 128\n \tprefetch(xdp->data + L1_CACHE_BYTES);\n #endif\n+\t/* Note, we get here by enabling legacy-rx via:\n+\t *\n+\t *    ethtool --set-priv-flags <dev> legacy-rx on\n+\t *\n+\t * In this mode, we currently get 0 extra XDP headroom as\n+\t * opposed to having legacy-rx off, where we process XDP\n+\t * packets going to stack via i40e_build_skb(). The latter\n+\t * provides us currently with 192 bytes of headroom.\n+\t *\n+\t * For i40e_construct_skb() mode it means that the\n+\t * xdp->data_meta will always point to xdp->data, since\n+\t * the helper cannot expand the head. Should this ever\n+\t * change in future for legacy-rx mode on, then lets also\n+\t * add xdp->data_meta handling here.\n+\t */\n \n \t/* allocate a skb to store the frags */\n \tskb = __napi_alloc_skb(&rx_ring->q_vector->napi,\n@@ -2083,19 +2098,25 @@ 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      struct xdp_buff *xdp)\n {\n-\tunsigned int size = xdp->data_end - xdp->data;\n+\tunsigned int metasize = xdp->data - xdp->data_meta;\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(sizeof(struct skb_shared_info)) +\n-\t\t\t\tSKB_DATA_ALIGN(I40E_SKB_PAD + size);\n+\t\t\t\tSKB_DATA_ALIGN(I40E_SKB_PAD +\n+\t\t\t\t\t       (xdp->data_end -\n+\t\t\t\t\t\txdp->data_hard_start));\n #endif\n \tstruct sk_buff *skb;\n \n-\t/* prefetch first cache line of first page */\n-\tprefetch(xdp->data);\n+\t/* Prefetch first cache line of first page. If xdp->data_meta\n+\t * is unused, this points extactly as xdp->data, otherwise we\n+\t * likely have a consumer accessing first few bytes of meta\n+\t * data, and then actual data.\n+\t */\n+\tprefetch(xdp->data_meta);\n #if L1_CACHE_BYTES < 128\n-\tprefetch(xdp->data + L1_CACHE_BYTES);\n+\tprefetch(xdp->data_meta + L1_CACHE_BYTES);\n #endif\n \t/* build an skb around the page buffer */\n \tskb = build_skb(xdp->data_hard_start, truesize);\n@@ -2103,8 +2124,10 @@ static struct sk_buff *i40e_build_skb(struct i40e_ring *rx_ring,\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+\tskb_reserve(skb, I40E_SKB_PAD + (xdp->data - xdp->data_hard_start));\n+\t__skb_put(skb, xdp->data_end - xdp->data);\n+\tif (metasize)\n+\t\tskb_metadata_set(skb, metasize);\n \n \t/* buffer is used by skb, update page_offset */\n #if (PAGE_SIZE < 8192)\n@@ -2341,7 +2364,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)\n \t\tif (!skb) {\n \t\t\txdp.data = page_address(rx_buffer->page) +\n \t\t\t\t   rx_buffer->page_offset;\n-\t\t\txdp_set_data_meta_invalid(&xdp);\n+\t\t\txdp.data_meta = xdp.data;\n \t\t\txdp.data_hard_start = xdp.data -\n \t\t\t\t\t      i40e_rx_offset(rx_ring);\n \t\t\txdp.data_end = xdp.data + size;\n",
    "prefixes": [
        "net-next"
    ]
}