From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by dpdk.org (Postfix) with ESMTP id CADC6B392 for ; Mon, 11 Aug 2014 22:42:20 +0200 (CEST) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 11 Aug 2014 13:45:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,844,1400050800"; d="scan'208";a="467575643" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by azsmga001.ch.intel.com with ESMTP; 11 Aug 2014 13:44:52 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s7BKiqbq020957; Mon, 11 Aug 2014 21:44:52 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s7BKiqx3017695; Mon, 11 Aug 2014 21:44:52 +0100 Received: (from bricha3@localhost) by sivswdev02.ir.intel.com with id s7BKiq17017691; Mon, 11 Aug 2014 21:44:52 +0100 From: Bruce Richardson To: dev@dpdk.org Date: Mon, 11 Aug 2014 21:44:44 +0100 Message-Id: <1407789890-17355-9-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 08/14] mbuf: split mbuf across two cache lines. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2014 20:42:21 -0000 This change splits the mbuf in two to move the pool and next pointers to the second cache line. This frees up 16 bytes in first cache line. Signed-off-by: Bruce Richardson --- app/test/test_mbuf.c | 2 +- lib/librte_mbuf/rte_mbuf.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c index 31ef9fa..65d62dc 100644 --- a/app/test/test_mbuf.c +++ b/app/test/test_mbuf.c @@ -782,7 +782,7 @@ test_failing_mbuf_sanity_check(void) int test_mbuf(void) { - RTE_BUILD_BUG_ON(sizeof(struct rte_mbuf) != 64); + RTE_BUILD_BUG_ON(sizeof(struct rte_mbuf) != CACHE_LINE_SIZE * 2); /* create pktmbuf pool if it does not exist */ if (pktmbuf_pool == NULL) { diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 566bb7e..a3e3e4f 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -137,6 +137,9 @@ union rte_vlan_macip { * The generic rte_mbuf, containing a packet mbuf. */ struct rte_mbuf { + /** dummy field marking start of first cache line */ + void *cache_line0[0]; + void *buf_addr; /**< Virtual address of segment buffer. */ phys_addr_t buf_physaddr; /**< Physical address of segment buffer. */ @@ -183,6 +186,8 @@ struct rte_mbuf { } hash; /**< hash information */ /* second cache line, fields only used in slow path or on TX */ + /** dummy field marking start of second cache line */ + void *cache_line1[0] __rte_cache_aligned; struct rte_mempool *pool; /**< Pool from which mbuf was allocated. */ struct rte_mbuf *next; /**< Next segment of scattered packet. */ -- 1.9.3