From patchwork Sat Dec 3 15:42:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Morten_Br=C3=B8rup?= X-Patchwork-Id: 120441 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EE529A0544; Sat, 3 Dec 2022 16:42:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8785340156; Sat, 3 Dec 2022 16:42:40 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 84862400D6 for ; Sat, 3 Dec 2022 16:42:38 +0100 (CET) Received: from dkrd2.smartsharesys.local ([192.168.4.12]) by smartserver.smartsharesystems.com with Microsoft SMTPSVC(6.0.3790.4675); Sat, 3 Dec 2022 16:42:36 +0100 From: =?utf-8?q?Morten_Br=C3=B8rup?= To: dev@dpdk.org Cc: =?utf-8?q?Morten_Br=C3=B8rup?= Subject: [PATCH] mbuf perf test, please ignore Date: Sat, 3 Dec 2022 16:42:34 +0100 Message-Id: <20221203154234.18141-1-mb@smartsharesystems.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-OriginalArrivalTime: 03 Dec 2022 15:42:36.0950 (UTC) FILETIME=[DE59F360:01D9072D] X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Playing around with the mbuf structure, trying to reduce the use of the second cache line in some common scenarios. Signed-off-by: Morten Brørup --- lib/mbuf/rte_mbuf_core.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h index a30e1e0eaf..c0c3b45024 100644 --- a/lib/mbuf/rte_mbuf_core.h +++ b/lib/mbuf/rte_mbuf_core.h @@ -594,25 +594,6 @@ struct rte_mbuf { uint16_t buf_len; /**< Length of segment buffer. */ - 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; - -#if RTE_IOVA_AS_PA - /** - * Next segment of scattered packet. Must be NULL in the last - * segment or in case of non-segmented packet. - */ - struct rte_mbuf *next; -#else - /** - * Reserved for dynamic fields - * when the next pointer is in first cache line (i.e. RTE_IOVA_AS_PA is 0). - */ - uint64_t dynfield2; -#endif - /* fields to support TX offloads */ RTE_STD_C11 union { @@ -651,6 +632,25 @@ struct rte_mbuf { }; }; + /* second cache line - fields only used in slow path or on TX */ + RTE_MARKER cacheline1 __rte_cache_min_aligned; + +#if RTE_IOVA_AS_PA + /** + * Next segment of scattered packet. Must be NULL in the last + * segment or in case of non-segmented packet. + */ + struct rte_mbuf *next; +#else + /** + * Reserved for dynamic fields + * when the next pointer is in first cache line (i.e. RTE_IOVA_AS_PA is 0). + */ + uint64_t dynfield2; +#endif + + struct rte_mempool *pool; /**< Pool from which mbuf was allocated. */ + /** Shared data for external buffer attached to mbuf. See * rte_pktmbuf_attach_extbuf(). */