From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Matz Subject: Re: [PATCH] mbuf: replace c memcpy code semantics with optimized rte_memcpy Date: Mon, 30 May 2016 10:44:59 +0200 Message-ID: <574BFD8B.3080806@6wind.com> References: <1464101442-10501-1-git-send-email-jerin.jacob@caviumnetworks.com> <57482079.1050605@intel.com> <20160527114205.GA15118@localhost.localdomain> <4125316.GWKk7IhZzc@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: "Hunt, David" , dev@dpdk.org, bruce.richardson@intel.com, konstantin.ananyev@intel.com To: Thomas Monjalon , Jerin Jacob Return-path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id D70272B88 for ; Mon, 30 May 2016 10:45:06 +0200 (CEST) In-Reply-To: <4125316.GWKk7IhZzc@xps13> 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" On 05/27/2016 05:05 PM, Thomas Monjalon wrote: > 2016-05-27 17:12, Jerin Jacob: >> IMHO, I think we should have means to abstract this _logical_ changes >> under conditional compilation flags and any arch/platform can choose >> to select what it suites better for that arch/platform. >> >> We may NOT need to have frequent patches to select the specific >> configuration, but logical patches under compilation flags can be accepted and >> each arch/platform can choose specific set configuration when we make >> the final release candidate for the release. >> >> Any thoughts? > > Yes having some #ifdefs for arch configuration may be reasonnable. > But other methods must be preffered first: > 1/ try implementing the function in arch-specific files I agree with Thomas. This option should be preferred, and I think we should avoid as much as possible to have: #if ARCH1 do stuff optimized for arch1 #elif ARCH2 do the same stuff optimized for arch2 #else ... In this particular case, rte_memcpy() seems to be the appropriate function, because it should already be arch-optimized. > 2/ and check at runtime if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_X > 3/ or check #ifdef RTE_MACHINE_CPUFLAG_X > 4/ or check #ifdef RTE_ARCH_Y > 5/ or check a specific #ifdef RTE_FEATURE_NAME to choose in config files > > The option 2 is a nice to have which implies other options. > > Maybe that doc/guides/contributing/design.rst needs to be updated. Regards, Olivier