From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id CCE572B88 for ; Wed, 22 Feb 2017 10:39:47 +0100 (CET) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3D08A804EE; Wed, 22 Feb 2017 09:39:48 +0000 (UTC) Received: from [10.36.116.199] (ovpn-116-199.ams2.redhat.com [10.36.116.199]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1M9diUh018814 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 22 Feb 2017 04:39:46 -0500 To: "Yang, Zhiyong" , Yuanhan Liu References: <20170221173243.20779-1-maxime.coquelin@redhat.com> <20170222013734.GJ18844@yliu-dev.sh.intel.com> Cc: "Liang, Cunming" , "Tan, Jianfeng" , "dev@dpdk.org" From: Maxime Coquelin Message-ID: <458456c8-57e7-94f3-a145-f73f66106418@redhat.com> Date: Wed, 22 Feb 2017 10:39:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 22 Feb 2017 09:39:48 +0000 (UTC) Subject: Re: [dpdk-dev] [RFC PATCH] net/virtio: Align Virtio-net header on cache line in receive path 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: Wed, 22 Feb 2017 09:39:48 -0000 On 02/22/2017 03:49 AM, Yang, Zhiyong wrote: > >> -----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 on >> cache line in receive path >> >> 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. >> >> I'm assuming you were testing pkt size <= (64 - hdr_size)? >> >>> 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. >> >> The another thing is, this patch always makes the pkt data cache unaligned >> for the first packet, which makes Zhihong's optimization on memcpy (for big >> 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. This is not possible to have both the first and next buffers aligned on cache line boundary, as we don't know whether the deccriptor will be the first one, or a subsequent one on Virtio side when we refill the vq. Cheers, Maxime > > Thanks > Zhiyong >