Show a patch.

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

{
    "id": 454,
    "url": "https://patches.dpdk.org/api/patches/454/",
    "web_url": "https://patches.dpdk.org/patch/454/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk"
    },
    "msgid": "<1411470497-10209-5-git-send-email-bruce.richardson@intel.com>",
    "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": "https://patches.dpdk.org/api/people/20/",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/patch/454/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/454/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/454/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,579,1406617200\"; d=\"scan'208\";a=\"479415914\"",
        "Precedence": "list",
        "X-Mailman-Version": "2.1.15",
        "X-Original-To": "patchwork@dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "References": "<1410948102-12740-1-git-send-email-bruce.richardson@intel.com>\n\t<1411470497-10209-1-git-send-email-bruce.richardson@intel.com>",
        "X-BeenThere": "dev@dpdk.org",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH v2 4/5] mbuf: add userdata pointer field",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 9EBBAAFCA;\n\tTue, 23 Sep 2014 13:02:19 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 0179C333\n\tfor <dev@dpdk.org>; Tue, 23 Sep 2014 13:02:14 +0200 (CEST)",
            "from azsmga001.ch.intel.com ([10.2.17.19])\n\tby fmsmga101.fm.intel.com with ESMTP; 23 Sep 2014 04:08:20 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby azsmga001.ch.intel.com with ESMTP; 23 Sep 2014 04:08:19 -0700",
            "from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com\n\t[10.237.217.46])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\ts8NB8IDr012724; Tue, 23 Sep 2014 12:08:18 +0100",
            "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev02.ir.intel.com with ESMTP id s8NB8Ic4010442;\n\tTue, 23 Sep 2014 12:08:18 +0100",
            "(from bricha3@localhost)\n\tby sivswdev02.ir.intel.com with  id s8NB8ITe010438;\n\tTue, 23 Sep 2014 12:08:18 +0100"
        ],
        "To": "dev@dpdk.org",
        "X-Mailer": "git-send-email 1.7.4.1",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-ExtLoop1": "1",
        "Date": "Tue, 23 Sep 2014 12:08:16 +0100",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "In-Reply-To": "<1411470497-10209-1-git-send-email-bruce.richardson@intel.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<1411470497-10209-5-git-send-email-bruce.richardson@intel.com>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "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 <bruce.richardson@intel.com>\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": [
        "dpdk-dev",
        "v2",
        "4/5"
    ]
}