From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 688F55934 for ; Thu, 22 Jan 2015 12:34:32 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 22 Jan 2015 03:34:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,448,1418112000"; d="scan'208";a="640947544" Received: from bricha3-mobl3.ger.corp.intel.com ([10.243.20.25]) by orsmga001.jf.intel.com with SMTP; 22 Jan 2015 03:34:28 -0800 Received: by (sSMTP sendmail emulation); Thu, 22 Jan 2015 11:34:27 +0025 Date: Thu, 22 Jan 2015 11:34:27 +0000 From: Bruce Richardson To: Tetsuya Mukawa Message-ID: <20150122113426.GC4580@bricha3-MOBL3> References: <54C070DF.1050006@huawei.com> <20150122044531.GA13230@mhcomputing.net> <54C08B54.50700@huawei.com> <20150122073526.GA14800@mhcomputing.net> <54C0CFB5.909@igel.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54C0CFB5.909@igel.co.jp> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] some questions about 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: Thu, 22 Jan 2015 11:34:32 -0000 On Thu, Jan 22, 2015 at 07:23:49PM +0900, Tetsuya Mukawa wrote: > On 2015/01/22 16:35, Matthew Hall wrote: > > On Thu, Jan 22, 2015 at 01:32:04PM +0800, Linhaifeng wrote: > >> Do you mean if call rte_memcpy before rte_eal_init() would crash?why? > > No guarantee. But a theory. It might use some things from the EAL init to > > figure out which version of the accelerated algorithm to use. > > This selection is done at compile-time. > And if the size is constant, I guess DPDK assumes memcpy is replaced by > inline __builtin_memcpy. > I haven't checked the performance of builtin memcpy, but probably much > faster. > Yes, that assumption is correct. A couple of years ago we discovered that for constant size values, the compiler would generate much faster code for us using a regular memcpy than rte_memcpy, hence the macro. /Bruce > Tetsuya > > > Matthew. > >