From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id C152E7EB0 for ; Thu, 4 Dec 2014 14:29:51 +0100 (CET) Received: from hmsreliant.think-freely.org ([2001:470:8:a08:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1XwWTa-0000Cg-9Q; Thu, 04 Dec 2014 08:29:48 -0500 Date: Thu, 4 Dec 2014 08:29:39 -0500 From: Neil Horman To: Thomas Monjalon Message-ID: <20141204132939.GB16249@hmsreliant.think-freely.org> References: <1417688048-23076-1-git-send-email-chaozhu@linux.vnet.ibm.com> <1417688048-23076-2-git-send-email-chaozhu@linux.vnet.ibm.com> <1950672.AxEg8fkUWW@xps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1950672.AxEg8fkUWW@xps13> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -2.9 (--) X-Spam-Status: No Cc: dev@dpdk.org, Chao Zhu Subject: Re: [dpdk-dev] [PATCH] Fix KNI compiling issue on IBM Power 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: Thu, 04 Dec 2014 13:29:52 -0000 On Thu, Dec 04, 2014 at 12:59:31PM +0100, Thomas Monjalon wrote: > > Because of different cache line size, the alignment of struct > > rte_kni_mbuf in rte_kni_common.h doesn't work on IBM Power. This patch > > changed from 64 to RTE_CACHE_LINE_SIZE micro to do the alignment. > > > > Signed-off-by: Chao Zhu > > Acked-by: Thomas Monjalon > > Applied > Woah! Slow down here, I'm not sure if this makes sense to fix his way. The exact same ifndef/define/endif construct is used for this macro in rte_memory.h. Currently their defined to the same vaule, but if that ever changes, this macro will return different values based on the order in which header files are included. That doesn't seem appropriate at all. > I wonder if we could try to guess the cache line size instead of > configuring it in many places. > Maybe we could use something like sysconf(_SC_LEVEL1_DCACHE_LINESIZE)? > This is a good idea, but I think its a bit broken for a few reasons: 1) _SC_LEVEL1_DCACHE_LINESIZE I don't think is POSIX mandated, so there is every possibility that the above won't work on BSD 2) While getting the cache line size dynamically is a great idea, dpdk has several locations that size structures based on processor cache line size, which implicitly requires a static cache line definition. It seems the right thing to do, in my mind is to define RTE_CACHE_LINE_SIZE per arch (perhaps in common/include/arch//rte_.h), then just let the build break if a given arch doesn't define it (i.e. make definig that value an arch reqirement). Neil > Thanks > -- > Thomas >