From patchwork Wed Sep 3 15:49:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 307 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id CBB8AB39C for ; Wed, 3 Sep 2014 17:45:40 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 03 Sep 2014 08:49:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,458,1406617200"; d="scan'208";a="593984551" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 03 Sep 2014 08:49:40 -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 s83Fne1K025435; Wed, 3 Sep 2014 16:49:40 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s83Fndha010486; Wed, 3 Sep 2014 16:49:39 +0100 Received: (from bricha3@localhost) by sivswdev02.ir.intel.com with id s83Fndh3010482; Wed, 3 Sep 2014 16:49:39 +0100 From: Bruce Richardson To: dev@dpdk.org Date: Wed, 3 Sep 2014 16:49:35 +0100 Message-Id: <1409759378-10113-11-git-send-email-bruce.richardson@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1409759378-10113-1-git-send-email-bruce.richardson@intel.com> References: <1409759378-10113-1-git-send-email-bruce.richardson@intel.com> Subject: [dpdk-dev] [PATCH 10/13] 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: Wed, 03 Sep 2014 15:45:43 -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 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c index e3d896b..82136de 100644 --- a/app/test/test_mbuf.c +++ b/app/test/test_mbuf.c @@ -782,7 +782,7 @@ test_failing_mbuf_sanity_check(void) static 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 591be95..db079ac 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -171,7 +171,8 @@ struct rte_mbuf { uint32_t sched; /**< Hierarchical scheduler */ } hash; /**< hash information */ - /* fields only used in slow path or on TX */ + /* second cache line - fields only used in slow path or on TX */ + MARKER cacheline1 __rte_cache_aligned; struct rte_mempool *pool; /**< Pool from which mbuf was allocated. */ struct rte_mbuf *next; /**< Next segment of scattered packet. */