Show a patch.

GET /api/patches/454/?format=api
Content-Type: application/json
Vary: Accept

    "id": 454,
    "url": "",
    "web_url": "",
    "project": {
        "id": 1,
        "url": "",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "",
        "list_email": "",
        "web_url": "",
        "scm_url": "git://",
        "webscm_url": ""
    "msgid": "<>",
    "date": "2014-09-23T11:08:16",
    "name": "[dpdk-dev,v2,4/5] mbuf: add userdata pointer field",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "19ca3ab6add5598721bcf34526efcab1d716e1f5",
    "submitter": {
        "id": 20,
        "url": "",
        "name": "Bruce Richardson",
        "email": ""
    "delegate": null,
    "mbox": "",
    "series": [],
    "comments": "",
    "check": "pending",
    "checks": "",
    "tags": {},
    "headers": {
        "X-Mailer": "git-send-email",
        "List-Id": "patches and discussions about DPDK <>",
        "Precedence": "list",
        "List-Help": "<>",
        "Date": "Tue, 23 Sep 2014 12:08:16 +0100",
        "X-BeenThere": "",
        "X-Mailman-Version": "2.1.15",
        "Delivered-To": "",
        "List-Subscribe": "<>,\n\t<>",
        "To": "",
        "Errors-To": "",
        "References": "<>\n\t<>",
        "Sender": "\"dev\" <>",
        "From": "Bruce Richardson <>",
        "Return-Path": "<>",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,579,1406617200\"; d=\"scan'208\";a=\"479415914\"",
        "List-Post": "<>",
        "Received": [
            "from [] (localhost [IPv6:::1])\n\tby (Postfix) with ESMTP id 9EBBAAFCA;\n\tTue, 23 Sep 2014 13:02:19 +0200 (CEST)",
            "from ( [])\n\tby (Postfix) with ESMTP id 0179C333\n\tfor <>; Tue, 23 Sep 2014 13:02:14 +0200 (CEST)",
            "from ([])\n\tby with ESMTP; 23 Sep 2014 04:08:20 -0700",
            "from ([])\n\tby with ESMTP; 23 Sep 2014 04:08:19 -0700",
            "from (\n\t[])\n\tby (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\ts8NB8IDr012724; Tue, 23 Sep 2014 12:08:18 +0100",
            "from (localhost [])\n\tby with ESMTP id s8NB8Ic4010442;\n\tTue, 23 Sep 2014 12:08:18 +0100",
            "(from bricha3@localhost)\n\tby with  id s8NB8ITe010438;\n\tTue, 23 Sep 2014 12:08:18 +0100"
        "List-Archive": "<>",
        "Subject": "[dpdk-dev] [PATCH v2 4/5] mbuf: add userdata pointer field",
        "In-Reply-To": "<>",
        "Message-Id": "<>",
        "X-ExtLoop1": "1",
        "List-Unsubscribe": "<>,\n\t<>",
        "X-Original-To": ""
    "content": "While some applications may store metadata about packets in the packet\nmbuf headroom, this is not a workable solution for packet metadata which\nis either:\n* larger than the headroom (or headroom is needed for adding pkt headers)\n* needs to be shared or copied among packets\n\nTo support these use cases in applications, we reserve a general\n\"userdata\" pointer field inside the second cache-line of the mbuf. This\nis better than having the application store the pointer to the external\nmetadata in the packet headroom, as it saves an additional cache-line\nfrom being used.\n\nApart from storing metadata, this field also provides a general 8-byte\nscratch space inside the mbuf for any other application uses that are\napplicable.\n\nChanges in V2:\n* made the userdata field always have 8-bytes available, even on 32-bit\n\nSigned-off-by: Bruce Richardson <>\n---\n lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h | 6 ++++--\n lib/librte_mbuf/rte_mbuf.h                                    | 6 ++++++\n 2 files changed, 10 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h\nindex 25ed672..e548161 100644\n--- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h\n+++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h\n@@ -116,8 +116,10 @@ struct rte_kni_mbuf {\n \tchar pad2[2];\n \tuint16_t data_len;      /**< Amount of data in segment buffer. */\n \tuint32_t pkt_len;       /**< Total pkt len: sum of all segment data_len. */\n-\tchar pad3[8];\n-\tvoid *pool __attribute__((__aligned__(64)));\n+\n+\t/* fields on second cache line */\n+\tchar pad3[8] __attribute__((__aligned__(64)));\n+\tvoid *pool;\n \tvoid *next;\n };\n \ndiff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h\nindex 8e27d2e..9e70d3b 100644\n--- a/lib/librte_mbuf/rte_mbuf.h\n+++ b/lib/librte_mbuf/rte_mbuf.h\n@@ -172,6 +172,12 @@ struct rte_mbuf {\n \n \t/* second cache line - fields only used in slow path or on TX */\n \tMARKER cacheline1 __rte_cache_aligned;\n+\n+\tunion {\n+\t\tvoid *userdata;   /**< Can be used for external metadata */\n+\t\tuint64_t udata64; /**< Allow 8-byte userdata on 32-bit */\n+\t};\n+\n \tstruct rte_mempool *pool; /**< Pool from which mbuf was allocated. */\n \tstruct rte_mbuf *next;    /**< Next segment of scattered packet. */\n \n",
    "prefixes": [