From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Yang, Zhiyong" Subject: Re: [RFC PATCH] net/virtio: Align Virtio-net header on cache line in receive path Date: Wed, 22 Feb 2017 02:49:05 +0000 Message-ID: References: <20170221173243.20779-1-maxime.coquelin@redhat.com> <20170222013734.GJ18844@yliu-dev.sh.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "Liang, Cunming" , "Tan, Jianfeng" , "dev@dpdk.org" To: Yuanhan Liu , Maxime Coquelin Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 637652B88 for ; Wed, 22 Feb 2017 03:49:11 +0100 (CET) In-Reply-To: <20170222013734.GJ18844@yliu-dev.sh.intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yuanhan Liu > Sent: Wednesday, February 22, 2017 9:38 AM > To: Maxime Coquelin > Cc: Liang, Cunming ; Tan, Jianfeng > ; dev@dpdk.org > Subject: Re: [dpdk-dev] [RFC PATCH] net/virtio: Align Virtio-net header o= n > cache line in receive path >=20 > On Tue, Feb 21, 2017 at 06:32:43PM +0100, Maxime Coquelin wrote: > > This patch aligns the Virtio-net header on a cache-line boundary to > > optimize cache utilization, as it puts the Virtio-net header (which is > > always accessed) on the same cache line as the packet header. > > > > For example with an application that forwards packets at L2 level, a > > single cache-line will be accessed with this patch, instead of two > > before. >=20 > I'm assuming you were testing pkt size <=3D (64 - hdr_size)? >=20 > > In case of multi-buffers packets, next segments will be aligned on a > > cache-line boundary, instead of cache-line boundary minus size of vnet > > header before. >=20 > The another thing is, this patch always makes the pkt data cache unaligne= d > for the first packet, which makes Zhihong's optimization on memcpy (for b= ig > packet) useless. Why not could we keep pkt data starting always on the cache-line boundary= ? In case of multi-buffer, the first remains unchanged, next segments can do = as Maxime said that. Thanks Zhiyong=20