Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/454/?format=api
http://patches.dpdk.org/api/patches/454/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1411470497-10209-5-git-send-email-bruce.richardson@intel.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "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", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1411470497-10209-5-git-send-email-bruce.richardson@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/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": "http://patches.dpdk.org/api/people/20/?format=api", "name": "Bruce Richardson", "email": "bruce.richardson@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1411470497-10209-5-git-send-email-bruce.richardson@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/454/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/454/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@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" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.04,579,1406617200\"; d=\"scan'208\";a=\"479415914\"", "From": "Bruce Richardson <bruce.richardson@intel.com>", "To": "dev@dpdk.org", "Date": "Tue, 23 Sep 2014 12:08:16 +0100", "Message-Id": "<1411470497-10209-5-git-send-email-bruce.richardson@intel.com>", "X-Mailer": "git-send-email 1.7.4.1", "In-Reply-To": "<1411470497-10209-1-git-send-email-bruce.richardson@intel.com>", "References": "<1410948102-12740-1-git-send-email-bruce.richardson@intel.com>\n\t<1411470497-10209-1-git-send-email-bruce.richardson@intel.com>", "Subject": "[dpdk-dev] [PATCH v2 4/5] mbuf: add userdata pointer field", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <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" ] }{ "id": 454, "url": "