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 1468E559C for ; Mon, 5 Dec 2016 11:36:23 +0100 (CET) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP; 05 Dec 2016 02:36:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,747,1477983600"; d="scan'208";a="38962241" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by fmsmga005.fm.intel.com with ESMTP; 05 Dec 2016 02:36:22 -0800 Date: Mon, 5 Dec 2016 18:37:09 +0800 From: Yuanhan Liu To: "Wang, Zhihong" Cc: "dev@dpdk.org" , Thomas Monjalon Message-ID: <20161205103709.GL24403@yliu-dev.sh.intel.com> References: <1480641582-56186-1-git-send-email-zhihong.wang@intel.com> <20161205082714.GJ24403@yliu-dev.sh.intel.com> <8F6C2BD409508844A0EFC19955BE09414E7FF22D@SHSMSX103.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8F6C2BD409508844A0EFC19955BE09414E7FF22D@SHSMSX103.ccr.corp.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] vhost: optimize vhost memcpy X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 10:36:24 -0000 On Mon, Dec 05, 2016 at 10:27:00AM +0000, Wang, Zhihong wrote: > > I like this function a lot, since it's really simple and straightforward! > > Moreover, it performs better. > > > > But, I don't quite like how this function is proposed: > > > > - rte_movX are more like internal help functions that should be used only > > in corresponding rte_memcpy.h file. > > > > - It's a good optimization, however, it will not benefit for other use > > cases, though vhost is the most typical case here. > > > > - The optimization proves to be good for X86, but think there is no > > guarantee it may behave well for other platforms, say ARM. > > > > I still would suggest you to go this way: move this function into x86's > > rte_memcpy.h and call it when the data is well aligned. > > > Do you mean to add something like rte_memcpy_aligned() in > lib/librte_eal/common/include/generic/rte_memcpy.h? Yes, but this one is not supposed to be exported as a public API. It should be called inside rte_memcpy (when data is well aligned). In this way, only rte_memcpy is exposed, and nothing else should be changed. --yliu > > I thought of this way before, and didn't choose it because it requires > changes in eal. But it would be a clean solution, I'd certainly like > to implement it this way if people are okay with it. > > > Thanks > Zhihong > > > > > > --yliu