From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from was59-1-82-226-113-214.fbx.proxad.net ([82.226.113.214] helo=[192.168.0.10]) by mail.droids-corp.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1b7Ir0-0006Yo-EP; Mon, 30 May 2016 10:47:18 +0200 To: Thomas Monjalon , Jerin Jacob References: <1464101442-10501-1-git-send-email-jerin.jacob@caviumnetworks.com> <57482079.1050605@intel.com> <20160527114205.GA15118@localhost.localdomain> <4125316.GWKk7IhZzc@xps13> Cc: "Hunt, David" , dev@dpdk.org, bruce.richardson@intel.com, konstantin.ananyev@intel.com From: Olivier Matz Message-ID: <574BFD8B.3080806@6wind.com> Date: Mon, 30 May 2016 10:44:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 In-Reply-To: <4125316.GWKk7IhZzc@xps13> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] mbuf: replace c memcpy code semantics with optimized rte_memcpy 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, 30 May 2016 08:45:07 -0000 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