[dpdk-dev] [RFC PATCH] net/virtio: Align Virtio-net header on cache line in receive path

Yang, Zhiyong zhiyong.yang at intel.com
Wed Feb 22 03:49:05 CET 2017


> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Yuanhan Liu
> Sent: Wednesday, February 22, 2017 9:38 AM
> To: Maxime Coquelin <maxime.coquelin at redhat.com>
> Cc: Liang, Cunming <cunming.liang at intel.com>; Tan, Jianfeng
> <jianfeng.tan at intel.com>; dev at 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.

Thanks
Zhiyong 


More information about the dev mailing list