From patchwork Mon Nov 9 21:29:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 83863 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0E2D9A0527; Mon, 9 Nov 2020 22:30:11 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6209B72E9; Mon, 9 Nov 2020 22:29:55 +0100 (CET) Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by dpdk.org (Postfix) with ESMTP id 0BA3C6A6F for ; Mon, 9 Nov 2020 22:29:50 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id A2DBB5809B2; Mon, 9 Nov 2020 16:29:49 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 09 Nov 2020 16:29:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=dAID93QLU6U2T CN8MH9UnqMZncPr4zCsttfX0evoQVk=; b=rUPQ4vrLykK0czV9Bel0TltS6zYcp ifPE3gXOYz22jvGOzv800RxK39aihCV64dMHu3ylQK13/2O446nRGjwK47n+r0PW Ycl6SbQ8OEmQhMWg7ERefmeyALNLdOr0RgtBoTbrpv0hDhKh3+pnLFVnsrykdt/j o6xjbccb5+ZrcRS+y8/bUipFOj+Mva54fOvuu8vTonffa0am1jgv1IBDPVTkaSH5 9lVu2MtQm2R8JC8F3SaP0rUUAMdhRwrWJjFKuOExXvyUVl9mdzH9RtPHJoLvLWSb D0TeBmsElnGPNyj7/RLWkqh1z9tSinW8XpBn5fz+XI/s+733ksofF8GmA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=dAID93QLU6U2TCN8MH9UnqMZncPr4zCsttfX0evoQVk=; b=NAxlsJwO rXR3y4sKf8R4XiafIx/jCVv5lyhR8K0HscCWsHvjUmuicBb1vJ83zWHdfaRlWNuB Suy5wyTdsmMcKVtsaMc1cMWjdIy4cQ1XluIrVbYXnLEoZa8iTd5rL4KGNccJpLvV 5Aan3A3oDN4d+McOhkDXD10NuJYzIKSmP8Q3MvVdocnbtk5LscKS4fhkFc/aN4At bukJK7utXH/3S/0YKlEU39VEcB0vohqYWBuOz/rdt7U48P5hzrkuy7yBuW4qaq0k FAB+y1z7jNp5jQj0RiB6t2tWRHx6YQH0Z1ZJzFSEKnLzlMXGOaRsTk5zpvvToLJO uctAcFKw/Q/dFg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudduhedgudehvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedt gfeutdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id C3253306301C; Mon, 9 Nov 2020 16:29:47 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: david.marchand@redhat.com, ferruh.yigit@intel.com, olivier.matz@6wind.com, mb@smartsharesystems.com, konstantin.ananyev@intel.com, andrew.rybchenko@oktetlabs.ru, viacheslavo@nvidia.com, ajit.khaparde@broadcom.com, jerinj@marvell.com, hemant.agrawal@nxp.com, Nithin Dabilpuram , Ankur Dwivedi , Anoob Joseph , Pavan Nikhilesh , Kiran Kumar K , Guy Kaneti Date: Mon, 9 Nov 2020 22:29:36 +0100 Message-Id: <20201109212937.989954-2-thomas@monjalon.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201109212937.989954-1-thomas@monjalon.net> References: <20201107155306.463148-1-thomas@monjalon.net> <20201109212937.989954-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 1/2] drivers: disable OCTEON TX2 in 32-bit build X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The drivers for OCTEON TX2 are not supported in 32-bit mode. Suggested-by: Jerin Jacob Signed-off-by: Thomas Monjalon Acked-by: Jerin Jacob --- drivers/common/octeontx2/meson.build | 18 ++++++------------ drivers/crypto/octeontx2/meson.build | 17 +++-------------- drivers/event/octeontx2/meson.build | 18 ++++++------------ drivers/mempool/octeontx2/meson.build | 18 ++++++------------ drivers/net/octeontx2/meson.build | 11 ++++++----- drivers/regex/octeontx2/meson.build | 22 +++------------------- 6 files changed, 30 insertions(+), 74 deletions(-) diff --git a/drivers/common/octeontx2/meson.build b/drivers/common/octeontx2/meson.build index f2c04342e9..84fb11524d 100644 --- a/drivers/common/octeontx2/meson.build +++ b/drivers/common/octeontx2/meson.build @@ -2,6 +2,12 @@ # Copyright(C) 2019 Marvell International Ltd. # +if not dpdk_conf.get('RTE_ARCH_64') + build = false + reason = 'only supported on 64-bit' + subdir_done() +endif + sources= files('otx2_dev.c', 'otx2_irq.c', 'otx2_mbox.c', @@ -9,18 +15,6 @@ sources= files('otx2_dev.c', 'otx2_sec_idev.c', ) -extra_flags = [] -# This integrated controller runs only on a arm64 machine, remove 32bit warnings -if not dpdk_conf.get('RTE_ARCH_64') - extra_flags += ['-Wno-int-to-pointer-cast', '-Wno-pointer-to-int-cast'] -endif - -foreach flag: extra_flags - if cc.has_argument(flag) - cflags += flag - endif -endforeach - deps = ['eal', 'pci', 'ethdev', 'kvargs'] includes += include_directories('../../common/octeontx2', '../../mempool/octeontx2', '../../bus/pci') diff --git a/drivers/crypto/octeontx2/meson.build b/drivers/crypto/octeontx2/meson.build index 4e4522cace..0aad4e9a16 100644 --- a/drivers/crypto/octeontx2/meson.build +++ b/drivers/crypto/octeontx2/meson.build @@ -1,9 +1,10 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright (C) 2019 Marvell International Ltd. -if not is_linux +if not is_linux or not dpdk_conf.get('RTE_ARCH_64') build = false - reason = 'only supported on Linux' + reason = 'only supported on 64-bit Linux' + subdir_done() endif deps += ['bus_pci'] @@ -21,18 +22,6 @@ sources = files('otx2_cryptodev.c', 'otx2_cryptodev_ops.c', 'otx2_cryptodev_sec.c') -extra_flags = [] -# This integrated controller runs only on a arm64 machine, remove 32bit warnings -if not dpdk_conf.get('RTE_ARCH_64') - extra_flags += ['-Wno-int-to-pointer-cast', '-Wno-pointer-to-int-cast'] -endif - -foreach flag: extra_flags - if cc.has_argument(flag) - cflags += flag - endif -endforeach - includes += include_directories('../../common/cpt') includes += include_directories('../../common/octeontx2') includes += include_directories('../../crypto/octeontx2') diff --git a/drivers/event/octeontx2/meson.build b/drivers/event/octeontx2/meson.build index 724da2e6b7..22e7e4cb63 100644 --- a/drivers/event/octeontx2/meson.build +++ b/drivers/event/octeontx2/meson.build @@ -2,6 +2,12 @@ # Copyright(C) 2019 Marvell International Ltd. # +if not dpdk_conf.get('RTE_ARCH_64') + build = false + reason = 'only supported on 64-bit' + subdir_done() +endif + sources = files('otx2_worker.c', 'otx2_worker_dual.c', 'otx2_evdev.c', @@ -13,18 +19,6 @@ sources = files('otx2_worker.c', 'otx2_tim_worker.c' ) -extra_flags = [] -# This integrated controller runs only on a arm64 machine, remove 32bit warnings -if not dpdk_conf.get('RTE_ARCH_64') - extra_flags += ['-Wno-int-to-pointer-cast', '-Wno-pointer-to-int-cast'] -endif - -foreach flag: extra_flags - if cc.has_argument(flag) - cflags += flag - endif -endforeach - deps += ['bus_pci', 'common_octeontx2', 'crypto_octeontx2', 'mempool_octeontx2', 'net_octeontx2'] includes += include_directories('../../crypto/octeontx2') diff --git a/drivers/mempool/octeontx2/meson.build b/drivers/mempool/octeontx2/meson.build index 0226f76d4b..0586321abe 100644 --- a/drivers/mempool/octeontx2/meson.build +++ b/drivers/mempool/octeontx2/meson.build @@ -5,6 +5,12 @@ if is_windows build = false reason = 'not supported on Windows' + subdir_done() +endif +if not dpdk_conf.get('RTE_ARCH_64') + build = false + reason = 'only supported on 64-bit' + subdir_done() endif sources = files('otx2_mempool_ops.c', @@ -13,16 +19,4 @@ sources = files('otx2_mempool_ops.c', 'otx2_mempool_debug.c' ) -extra_flags = [] -# This integrated controller runs only on a arm64 machine, remove 32bit warnings -if not dpdk_conf.get('RTE_ARCH_64') - extra_flags += ['-Wno-int-to-pointer-cast', '-Wno-pointer-to-int-cast'] -endif - -foreach flag: extra_flags - if cc.has_argument(flag) - cflags += flag - endif -endforeach - deps += ['eal', 'mbuf', 'kvargs', 'bus_pci', 'common_octeontx2', 'mempool'] diff --git a/drivers/net/octeontx2/meson.build b/drivers/net/octeontx2/meson.build index 599ade6727..638c04a2fe 100644 --- a/drivers/net/octeontx2/meson.build +++ b/drivers/net/octeontx2/meson.build @@ -2,6 +2,12 @@ # Copyright(C) 2019 Marvell International Ltd. # +if not dpdk_conf.get('RTE_ARCH_64') + build = false + reason = 'only supported on 64-bit' + subdir_done() +endif + sources = files('otx2_rx.c', 'otx2_tx.c', 'otx2_tm.c', @@ -29,11 +35,6 @@ deps += ['bus_pci', 'cryptodev', 'eventdev', 'security'] deps += ['common_octeontx2', 'mempool_octeontx2'] extra_flags = ['-flax-vector-conversions'] -# This integrated controller runs only on a arm64 machine, remove 32bit warnings -if not dpdk_conf.get('RTE_ARCH_64') - extra_flags += ['-Wno-int-to-pointer-cast', '-Wno-pointer-to-int-cast'] -endif - foreach flag: extra_flags if cc.has_argument(flag) cflags += flag diff --git a/drivers/regex/octeontx2/meson.build b/drivers/regex/octeontx2/meson.build index aada0b5601..34e51728c2 100644 --- a/drivers/regex/octeontx2/meson.build +++ b/drivers/regex/octeontx2/meson.build @@ -2,9 +2,10 @@ # Copyright(C) 2020 Marvell International Ltd. # -if not is_linux +if not is_linux or not dpdk_conf.get('RTE_ARCH_64') build = false - reason = 'only supported on Linux' + reason = 'only supported on 64-bit Linux' + subdir_done() endif lib = cc.find_library('librxp_compiler', required: false) @@ -21,23 +22,6 @@ sources = files('otx2_regexdev.c', 'otx2_regexdev_compiler.c' ) -extra_flags = [] -# This integrated controller runs only on a arm64 machine, remove 32bit warnings -if not dpdk_conf.get('RTE_ARCH_64') - extra_flags += ['-Wno-int-to-pointer-cast', '-Wno-pointer-to-int-cast'] -endif - -# for clang 32-bit compiles we need libatomic for 64-bit atomic ops -if cc.get_id() == 'clang' and dpdk_conf.get('RTE_ARCH_64') == false - ext_deps += cc.find_library('atomic') -endif - -foreach flag: extra_flags - if cc.has_argument(flag) - cflags += flag - endif -endforeach - fmt_name = 'octeontx2_regex' deps += ['bus_pci', 'common_octeontx2', 'regexdev'] From patchwork Mon Nov 9 21:29:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 83864 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0FDE5A0527; Mon, 9 Nov 2020 22:30:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 84ECC9B04; Mon, 9 Nov 2020 22:29:58 +0100 (CET) Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by dpdk.org (Postfix) with ESMTP id 1DE376CA9 for ; Mon, 9 Nov 2020 22:29:54 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id C6FAB5809C8; Mon, 9 Nov 2020 16:29:52 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 09 Nov 2020 16:29:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=ov1WSuAUhi/dT JoFEAPd6RiFNrGXkpX/qwiXmWgsLhU=; b=er5qTxvnSFg4TlxzKF9ZC/9l9Opvc iJWICc8NhA31pQNEUAxLAs42LWLNXrkZQHVQFUTP6ozy0fWmm2oFf/3ax97CuiIt 0H/YRRnZmHwtMbFSBFDLgXQ/uyv+mGfMfMvu8xcyq5MTJHO6m+SSADIstxlGbNIQ Mwp7nYzS4O8+T4UsHtCUI73DumtHIgx3QGkVvV9GhNsI9BP+9c6/ER8kKKziZXJ6 v74SBciNMshQzPdp/Xagw2s3k5nV0PzzdxhJog3pBPirosGdYejrqIsodGG94fh6 DpwQqWZr6800miSKUWaOd+OpiRMH0YgvD5wrsu+PcsbZ0KwbanSfTy0Kg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=ov1WSuAUhi/dTJoFEAPd6RiFNrGXkpX/qwiXmWgsLhU=; b=fL1v8p5w TwigSuUrnd+gfHETAvbekYLwLI3rXHNrjWs3W8VH9om8VpH+1a+zEt7hL1hV4rux MHOG42IbIXEbALyygZuiUpBRMQDRL4+niaO28EhzaxwcMPqIWUiiAOEEH5fYJLuK 03dMHuvubprIhApweJvupTfB3bJ/n9aaAvHgKf2gEwYQueaazIsLjMym/sr/ntnh J9qXEhjRcEVohemQeyhzPgR/zSZtCBSgEvEn4u8LQ190B9AV5jwcanz+UN5HFXsh 6JNu4oPVTE1uY5s32DfHwsS6+7EdrBxuLHnrBi1183hax4m9o8mRMTmeBDptWjxo zCM7UNWnMFMSuQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudduhedgudehvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedtjeegffduuedvtdehieffvdevjeegleevheevteekleejieej teeuteeugeelvdenucffohhmrghinhepughpughkrdhorhhgpdihohhuthhusggvrdgtoh hmnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvg ht X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id F1A733063067; Mon, 9 Nov 2020 16:29:50 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: david.marchand@redhat.com, ferruh.yigit@intel.com, olivier.matz@6wind.com, mb@smartsharesystems.com, konstantin.ananyev@intel.com, andrew.rybchenko@oktetlabs.ru, viacheslavo@nvidia.com, ajit.khaparde@broadcom.com, jerinj@marvell.com, hemant.agrawal@nxp.com, Ray Kinsella , Neil Horman Date: Mon, 9 Nov 2020 22:29:37 +0100 Message-Id: <20201109212937.989954-3-thomas@monjalon.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201109212937.989954-1-thomas@monjalon.net> References: <20201107155306.463148-1-thomas@monjalon.net> <20201109212937.989954-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 2/2] mbuf: move pool pointer in first half X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" According to the Technical Board decision (http://mails.dpdk.org/archives/dev/2020-November/191859.html), the mempool pointer in the mbuf struct is moved from the second to the first half. It may increase performance in some cases on systems having 64-byte cache line, i.e. mbuf split in two cache lines. Due to this change, tx_offload is moved. Hopefully no vector data path is impacted. Moving this field gives more space to dynfield1 while dropping the temporary dynfield0. This is how the mbuf layout looks like (pahole-style): word type name byte size 0 void * buf_addr; /* 0 + 8 */ 1 rte_iova_t buf_iova /* 8 + 8 */ /* --- RTE_MARKER64 rearm_data; */ 2 uint16_t data_off; /* 16 + 2 */ uint16_t refcnt; /* 18 + 2 */ uint16_t nb_segs; /* 20 + 2 */ uint16_t port; /* 22 + 2 */ 3 uint64_t ol_flags; /* 24 + 8 */ /* --- RTE_MARKER rx_descriptor_fields1; */ 4 uint32_t union packet_type; /* 32 + 4 */ uint32_t pkt_len; /* 36 + 4 */ 5 uint16_t data_len; /* 40 + 2 */ uint16_t vlan_tci; /* 42 + 2 */ 5.5 uint64_t union hash; /* 44 + 8 */ 6.5 uint16_t vlan_tci_outer; /* 52 + 2 */ uint16_t buf_len; /* 54 + 2 */ 7 struct rte_mempool * pool; /* 56 + 8 */ /* --- RTE_MARKER cacheline1; */ 8 struct rte_mbuf * next; /* 64 + 8 */ 9 uint64_t union tx_offload; /* 72 + 8 */ 10 struct rte_mbuf_ext_shared_info * shinfo; /* 80 + 8 */ 11 uint16_t priv_size; /* 88 + 2 */ uint16_t timesync; /* 90 + 2 */ 11.5 uint32_t dynfield1[9]; /* 92 + 36 */ 16 /* --- END 128 */ Signed-off-by: Thomas Monjalon Acked-by: Morten Brørup Acked-by: Olivier Matz Acked-by: Jerin Jacob Acked-by: Stephen Hemminger --- doc/guides/rel_notes/deprecation.rst | 7 ------- lib/librte_kni/rte_kni_common.h | 3 ++- lib/librte_mbuf/rte_mbuf.h | 1 - lib/librte_mbuf/rte_mbuf_core.h | 5 ++--- lib/librte_mbuf/rte_mbuf_dyn.c | 1 - 5 files changed, 4 insertions(+), 13 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index f3258eb3f7..efb09f0c5e 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -81,13 +81,6 @@ Deprecation Notices us extending existing enum/define. One solution can be using a fixed size array instead of ``.*MAX.*`` value. -* mbuf: Some fields will be converted to dynamic API in DPDK 20.11 - in order to reserve more space for the dynamic fields, as explained in - `this presentation `_. - As a consequence, the layout of the ``struct rte_mbuf`` will be re-arranged, - avoiding impact on vectorized implementation of the driver datapaths, - while evaluating performance gains of a better use of the first cache line. - * ethdev: The flow director API, including ``rte_eth_conf.fdir_conf`` field, and the related structures (``rte_fdir_*`` and ``rte_eth_fdir_*``), will be removed in DPDK 20.11. diff --git a/lib/librte_kni/rte_kni_common.h b/lib/librte_kni/rte_kni_common.h index 36d66e2ffa..ffb3182731 100644 --- a/lib/librte_kni/rte_kni_common.h +++ b/lib/librte_kni/rte_kni_common.h @@ -84,10 +84,11 @@ struct rte_kni_mbuf { char pad2[4]; uint32_t pkt_len; /**< Total pkt len: sum of all segment data_len. */ uint16_t data_len; /**< Amount of data in segment buffer. */ + char pad3[14]; + void *pool; /* fields on second cache line */ __attribute__((__aligned__(RTE_CACHE_LINE_MIN_SIZE))) - void *pool; void *next; /**< Physical address of next mbuf in kernel. */ }; diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 3190a29cce..c4c9ebfaa0 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -1107,7 +1107,6 @@ rte_pktmbuf_attach_extbuf(struct rte_mbuf *m, void *buf_addr, static inline void rte_mbuf_dynfield_copy(struct rte_mbuf *mdst, const struct rte_mbuf *msrc) { - memcpy(&mdst->dynfield0, msrc->dynfield0, sizeof(mdst->dynfield0)); memcpy(&mdst->dynfield1, msrc->dynfield1, sizeof(mdst->dynfield1)); } diff --git a/lib/librte_mbuf/rte_mbuf_core.h b/lib/librte_mbuf/rte_mbuf_core.h index debaace95a..567551deab 100644 --- a/lib/librte_mbuf/rte_mbuf_core.h +++ b/lib/librte_mbuf/rte_mbuf_core.h @@ -586,12 +586,11 @@ struct rte_mbuf { uint16_t buf_len; /**< Length of segment buffer. */ - uint64_t dynfield0[1]; /**< Reserved for dynamic fields. */ + struct rte_mempool *pool; /**< Pool from which mbuf was allocated. */ /* second cache line - fields only used in slow path or on TX */ RTE_MARKER cacheline1 __rte_cache_min_aligned; - struct rte_mempool *pool; /**< Pool from which mbuf was allocated. */ struct rte_mbuf *next; /**< Next segment of scattered packet. */ /* fields to support TX offloads */ @@ -645,7 +644,7 @@ struct rte_mbuf { /** Timesync flags for use with IEEE1588. */ uint16_t timesync; - uint32_t dynfield1[7]; /**< Reserved for dynamic fields. */ + uint32_t dynfield1[9]; /**< Reserved for dynamic fields. */ } __rte_cache_aligned; /** diff --git a/lib/librte_mbuf/rte_mbuf_dyn.c b/lib/librte_mbuf/rte_mbuf_dyn.c index fd3e019a22..7d5e942bf0 100644 --- a/lib/librte_mbuf/rte_mbuf_dyn.c +++ b/lib/librte_mbuf/rte_mbuf_dyn.c @@ -125,7 +125,6 @@ init_shared_mem(void) * rte_mbuf_dynfield_copy(). */ memset(shm, 0, sizeof(*shm)); - mark_free(dynfield0); mark_free(dynfield1); /* init free_flags */