From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <zhihong.wang@intel.com>
Received: from mga02.intel.com (mga02.intel.com [134.134.136.20])
 by dpdk.org (Postfix) with ESMTP id 7BF7968AB
 for <dev@dpdk.org>; Mon,  5 Dec 2016 11:27:04 +0100 (CET)
Received: from orsmga005.jf.intel.com ([10.7.209.41])
 by orsmga101.jf.intel.com with ESMTP; 05 Dec 2016 02:27:04 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.33,747,1477983600"; d="scan'208";a="38834762"
Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205])
 by orsmga005.jf.intel.com with ESMTP; 05 Dec 2016 02:27:04 -0800
Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by
 fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS)
 id 14.3.248.2; Mon, 5 Dec 2016 02:27:03 -0800
Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by
 FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS)
 id 14.3.248.2; Mon, 5 Dec 2016 02:27:02 -0800
Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.96]) by
 SHSMSX152.ccr.corp.intel.com ([169.254.6.218]) with mapi id 14.03.0248.002;
 Mon, 5 Dec 2016 18:27:01 +0800
From: "Wang, Zhihong" <zhihong.wang@intel.com>
To: Yuanhan Liu <yuanhan.liu@linux.intel.com>
CC: "dev@dpdk.org" <dev@dpdk.org>, Thomas Monjalon <thomas.monjalon@6wind.com>
Thread-Topic: [PATCH] vhost: optimize vhost memcpy
Thread-Index: AQHSTHYyWBpmyoksL0mYHHQwaEW9IaD4g7oAgACkvPA=
Date: Mon, 5 Dec 2016 10:27:00 +0000
Message-ID: <8F6C2BD409508844A0EFC19955BE09414E7FF22D@SHSMSX103.ccr.corp.intel.com>
References: <1480641582-56186-1-git-send-email-zhihong.wang@intel.com>
 <20161205082714.GJ24403@yliu-dev.sh.intel.com>
In-Reply-To: <20161205082714.GJ24403@yliu-dev.sh.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 05 Dec 2016 10:27:05 -0000

> I like this function a lot, since it's really simple and straightforward!
> Moreover, it performs better.
>=20
> But, I don't quite like how this function is proposed:
>=20
> - rte_movX are more like internal help functions that should be used only
>   in corresponding rte_memcpy.h file.
>=20
> - It's a good optimization, however, it will not benefit for other use
>   cases, though vhost is the most typical case here.
>=20
> - The optimization proves to be good for X86, but think there is no
>   guarantee it may behave well for other platforms, say ARM.
>=20
> 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=20
lib/librte_eal/common/include/generic/rte_memcpy.h?

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


>=20
> 	--yliu