Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/142/?format=api
https://patches.dpdk.org/api/patches/142/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1407789890-17355-7-git-send-email-bruce.richardson@intel.com/", "project": { "id": 1, "url": "https://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": "<1407789890-17355-7-git-send-email-bruce.richardson@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1407789890-17355-7-git-send-email-bruce.richardson@intel.com", "date": "2014-08-11T20:44:42", "name": "[dpdk-dev,RFC,06/14] mbuf: reorder fields by time-of-use", "commit_ref": "", "pull_url": "", "state": "rfc", "archived": true, "hash": "47173ebe47010e545ddcf9d3fa1a7f6516bca0b2", "submitter": { "id": 20, "url": "https://patches.dpdk.org/api/people/20/?format=api", "name": "Bruce Richardson", "email": "bruce.richardson@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1407789890-17355-7-git-send-email-bruce.richardson@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/142/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/142/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<bricha3@ecsmtp.ir.intel.com>", "Received": [ "from mga09.intel.com (mga09.intel.com [134.134.136.24])\r\n\tby dpdk.org (Postfix) with ESMTP id 8E2F7B391\r\n\tfor <dev@dpdk.org>; Mon, 11 Aug 2014 22:44:06 +0200 (CEST)", "from orsmga002.jf.intel.com ([10.7.209.21])\r\n\tby orsmga102.jf.intel.com with ESMTP; 11 Aug 2014 13:41:06 -0700", "from irvmail001.ir.intel.com ([163.33.26.43])\r\n\tby orsmga002.jf.intel.com with ESMTP; 11 Aug 2014 13:44:52 -0700", "from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com\r\n\t[10.237.217.46])\r\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\r\n\ts7BKiqmE020951; Mon, 11 Aug 2014 21:44:52 +0100", "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\r\n\tby sivswdev02.ir.intel.com with ESMTP id s7BKiq4X017681;\r\n\tMon, 11 Aug 2014 21:44:52 +0100", "(from bricha3@localhost)\r\n\tby sivswdev02.ir.intel.com with id s7BKiqnB017677;\r\n\tMon, 11 Aug 2014 21:44:52 +0100" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.01,844,1400050800\"; d=\"scan'208\";a=\"586659689\"", "From": "Bruce Richardson <bruce.richardson@intel.com>", "To": "dev@dpdk.org", "Date": "Mon, 11 Aug 2014 21:44:42 +0100", "Message-Id": "<1407789890-17355-7-git-send-email-bruce.richardson@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": "<1407789890-17355-1-git-send-email-bruce.richardson@intel.com>", "References": "<1407789890-17355-1-git-send-email-bruce.richardson@intel.com>", "Subject": "[dpdk-dev] [RFC PATCH 06/14] mbuf: reorder fields by time-of-use", "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>,\r\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>,\r\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "X-List-Received-Date": "Mon, 11 Aug 2014 20:44:07 -0000" }, "content": "* Reorder the fields in the mbuf so that we have fields that are used\ntogether side-by-side in the structure. This means that we have a\ncontiguous block of 8-bytes in the mbuf which are used to reset an mbuf\nof descriptor rearm.\n* Where needed add in a dummy fields to overwrite values 8 or 16 bytes\nat a time, when doing RX or RX descriptor rearm. This avoids compiler\nwarnings when using uint64_t values to overwrite a set of smaller\nvalues.\n* At the end, place fields that are only used for TX or for the slower\nRX path, and mark them as down to be moved to a second cache line.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n lib/librte_mbuf/rte_mbuf.c | 2 +-\n lib/librte_mbuf/rte_mbuf.h | 37 +++++++++++++++++++++----------------\n 2 files changed, 22 insertions(+), 17 deletions(-)", "diff": "diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c\r\nindex 64f1587..594b910 100644\r\n--- a/lib/librte_mbuf/rte_mbuf.c\r\n+++ b/lib/librte_mbuf/rte_mbuf.c\r\n@@ -161,7 +161,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)\r\n \r\n \tfprintf(f, \"dump mbuf at 0x%p, phys=%\"PRIx64\", buf_len=%u\\n\",\r\n \t m, (uint64_t)m->buf_physaddr, (unsigned)m->buf_len);\r\n-\tfprintf(f, \" pkt_len=%\"PRIu32\", ol_flags=%\"PRIx16\", nb_segs=%u, \"\r\n+\tfprintf(f, \" pkt_len=%\"PRIu32\", ol_flags=%\"PRIx64\", nb_segs=%u, \"\r\n \t \"in_port=%u\\n\", m->pkt_len, m->ol_flags,\r\n \t (unsigned)m->nb_segs, (unsigned)m->port);\r\n \tnb_segs = m->nb_segs;\r\ndiff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h\r\nindex e0981c9..566bb7e 100644\r\n--- a/lib/librte_mbuf/rte_mbuf.h\r\n+++ b/lib/librte_mbuf/rte_mbuf.h\r\n@@ -132,22 +132,20 @@ union rte_vlan_macip {\r\n /**< MAC+IP length. */\r\n #define TX_MACIP_LEN_CMP_MASK (TX_MAC_LEN_CMP_MASK | TX_IP_LEN_CMP_MASK)\r\n \r\n+\r\n /**\r\n * The generic rte_mbuf, containing a packet mbuf.\r\n */\r\n struct rte_mbuf {\r\n-\tstruct rte_mempool *pool; /**< Pool from which mbuf was allocated. */\r\n \tvoid *buf_addr; /**< Virtual address of segment buffer. */\r\n \tphys_addr_t buf_physaddr; /**< Physical address of segment buffer. */\r\n-\tuint16_t buf_len; /**< Length of segment buffer. */\r\n \r\n-\t/* valid for any segment */\r\n-\tstruct rte_mbuf *next; /**< Next segment of scattered packet. */\r\n+\t/* next 8 bytes are initialised on RX descriptor rearm */\r\n+\tuint64_t rearm_data[0]; /**< dummy element so we can get uin64_t ptrs\r\n+\t * to this part of the mbuf without alias error\r\n+\t */\r\n+\tuint16_t buf_len; /**< Length of segment buffer. */\r\n \tuint16_t data_off;\r\n-\tuint16_t data_len; /**< Amount of data in segment buffer. */\r\n-\tuint32_t pkt_len; /**< Total pkt len: sum of all segments. */\r\n-\r\n-#ifdef RTE_MBUF_REFCNT\r\n \t/**\r\n \t * 16-bit Reference counter.\r\n \t * It should only be accessed using the following functions:\r\n@@ -157,20 +155,23 @@ struct rte_mbuf {\r\n \t * config option.\r\n \t */\r\n \tunion {\r\n+#ifdef RTE_MBUF_REFCNT\r\n \t\trte_atomic16_t refcnt_atomic; /**< Atomically accessed refcnt */\r\n \t\tuint16_t refcnt; /**< Non-atomically accessed refcnt */\r\n-\t};\r\n-#else\r\n-\tuint16_t refcnt_reserved; /**< Do not use this field */\r\n #endif\r\n-\r\n-\t/* these fields are valid for first segment only */\r\n+\t\tuint16_t refcnt_reserved; /**< Do not use this field */\r\n+\t};\r\n \tuint8_t nb_segs; /**< Number of segments. */\r\n \tuint8_t port; /**< Input port. */\r\n-\tuint16_t ol_flags; /**< Offload features. */\r\n-\tuint16_t reserved; /**< Unused field. Required for padding. */\r\n \r\n-\t/* offload features, valid for first segment only */\r\n+\t/* remaining bytes are set on RX when pulling packet from descriptor */\r\n+\tuint64_t ol_flags; /**< Offload features. */\r\n+\r\n+\t__m128i rx_descriptor_fields1[0]; /**< dummy field used as marker for\r\n+\t * writes in a vector driver */\r\n+\tuint16_t packet_type; /**< Type of packet, e.g. protocols used */\r\n+\tuint16_t data_len; /**< Amount of data in segment buffer. */\r\n+\tuint32_t pkt_len; /**< Total pkt len: sum of all segments. */\r\n \tunion rte_vlan_macip vlan_macip;\r\n \tunion {\r\n \t\tuint32_t rss; /**< RSS hash result if RSS enabled */\r\n@@ -181,6 +182,10 @@ struct rte_mbuf {\r\n \t\tuint32_t sched; /**< Hierarchical scheduler */\r\n \t} hash; /**< hash information */\r\n \r\n+\t/* second cache line, fields only used in slow path or on TX */\r\n+\tstruct rte_mempool *pool; /**< Pool from which mbuf was allocated. */\r\n+\tstruct rte_mbuf *next; /**< Next segment of scattered packet. */\r\n+\r\n \tunion {\r\n \t\tuint8_t metadata[0];\r\n \t\tuint16_t metadata16[0];\r\n", "prefixes": [ "dpdk-dev", "RFC", "06/14" ] }{ "id": 142, "url": "