From patchwork Fri Sep 26 09:36:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Zhu X-Patchwork-Id: 574 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 44C507E3F; Fri, 26 Sep 2014 11:30:28 +0200 (CEST) Received: from e8.ny.us.ibm.com (e8.ny.us.ibm.com [32.97.182.138]) by dpdk.org (Postfix) with ESMTP id 8C09B7E07 for ; Fri, 26 Sep 2014 11:30:21 +0200 (CEST) Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 26 Sep 2014 05:36:42 -0400 Received: from d01dlp03.pok.ibm.com (9.56.250.168) by e8.ny.us.ibm.com (192.168.1.108) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 26 Sep 2014 05:36:40 -0400 Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 511E0C90043 for ; Fri, 26 Sep 2014 05:25:24 -0400 (EDT) Received: from d01av05.pok.ibm.com (d01av05.pok.ibm.com [9.56.224.195]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s8Q9aV6S65929384 for ; Fri, 26 Sep 2014 09:36:39 GMT Received: from d01av05.pok.ibm.com (localhost [127.0.0.1]) by d01av05.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s8Q9a7fB002948 for ; Fri, 26 Sep 2014 05:36:07 -0400 Received: from d01hub02.pok.ibm.com (d01hub02.pok.ibm.com [9.63.10.236]) by d01av05.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s8Q9a7wN002655 for ; Fri, 26 Sep 2014 05:36:07 -0400 Received: from localhost.localdomain ([9.186.57.14]) by rescrl1.research.ibm.com (IBM Domino Release 9.0.1) with ESMTP id 2014092617352674-312556 ; Fri, 26 Sep 2014 17:35:26 +0800 From: Chao Zhu To: dev@dpdk.org Date: Fri, 26 Sep 2014 05:36:24 -0400 Message-Id: <1411724186-8036-11-git-send-email-bjzhuc@cn.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1411724186-8036-1-git-send-email-bjzhuc@cn.ibm.com> References: <1411724186-8036-1-git-send-email-bjzhuc@cn.ibm.com> X-MIMETrack: Itemize by SMTP Server on rescrl1/Research/Affiliated/IBM(Release 9.0.1|October 14, 2013) at 2014/09/26 17:35:26, Serialize by Router on D01HUB02/01/H/IBM(Release 8.5.3FP2 ZX853FP2HF5|February, 2013) at 09/26/2014 05:36:06, Serialize complete at 09/26/2014 05:36:06 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14092609-0320-0000-0000-000000986E0D Subject: [dpdk-dev] [PATCH 10/12] Add cache size define for IBM Power Architecture 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" IBM Power architecture has different cache line size (128 bytes) than x86 (64 bytes). This patch defines CACHE_LINE_SIZE to 128 bytes to override the default value 64 bytes to support IBM Power Architecture. Signed-off-by: Chao Zhu --- app/test/test_malloc.c | 8 ++++---- app/test/test_mbuf.c | 2 +- mk/arch/powerpc/rte.vars.mk | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c index ee34ca3..63e6b32 100644 --- a/app/test/test_malloc.c +++ b/app/test/test_malloc.c @@ -300,9 +300,9 @@ test_big_alloc(void) size_t size =rte_str_to_size(MALLOC_MEMZONE_SIZE)*2; int align = 0; #ifndef RTE_LIBRTE_MALLOC_DEBUG - int overhead = 64 + 64; + int overhead = CACHE_LINE_SIZE + CACHE_LINE_SIZE; #else - int overhead = 64 + 64 + 64; + int overhead = CACHE_LINE_SIZE + CACHE_LINE_SIZE + CACHE_LINE_SIZE; #endif rte_malloc_get_socket_stats(socket, &pre_stats); @@ -356,9 +356,9 @@ test_multi_alloc_statistics(void) #ifndef RTE_LIBRTE_MALLOC_DEBUG int trailer_size = 0; #else - int trailer_size = 64; + int trailer_size = CACHE_LINE_SIZE; #endif - int overhead = 64 + trailer_size; + int overhead = CACHE_LINE_SIZE + trailer_size; rte_malloc_get_socket_stats(socket, &pre_stats); diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c index 21024e7..03da329 100644 --- a/app/test/test_mbuf.c +++ b/app/test/test_mbuf.c @@ -832,7 +832,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); /* create pktmbuf pool if it does not exist */ if (pktmbuf_pool == NULL) { diff --git a/mk/arch/powerpc/rte.vars.mk b/mk/arch/powerpc/rte.vars.mk index 363fcd1..dfdeaea 100644 --- a/mk/arch/powerpc/rte.vars.mk +++ b/mk/arch/powerpc/rte.vars.mk @@ -32,7 +32,7 @@ ARCH ?= powerpc CROSS ?= -CPU_CFLAGS ?= -m64 +CPU_CFLAGS ?= -m64 -DCACHE_LINE_SIZE=128 CPU_LDFLAGS ?= CPU_ASFLAGS ?= -felf64