From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH] virtio: fix allocating virtnet_rx not mem aligned Date: Mon, 13 Jun 2016 17:51:46 +0800 Message-ID: <20160613095146.GP10038@yliu-dev.sh.intel.com> References: <1465741782-126976-1-git-send-email-jianfeng.tan@intel.com> <20160613092101.GN10038@yliu-dev.sh.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, huawei.xie@intel.com To: Jianfeng Tan Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 9B3EC475E for ; Mon, 13 Jun 2016 11:49:52 +0200 (CEST) Content-Disposition: inline In-Reply-To: <20160613092101.GN10038@yliu-dev.sh.intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Jun 13, 2016 at 05:21:01PM +0800, Yuanhan Liu wrote: > On Sun, Jun 12, 2016 at 02:29:42PM +0000, Jianfeng Tan wrote: > > Compile DPDK with clang, below line in virtio_rxtx.c could be > > optimized with four "VMOVAPS ymm, m256". > > memset(&rxvq->fake_mbuf, 0, sizeof(rxvq->fake_mbuf)); > > > > This instruction requires memory address is 32-byte aligned. > > Or, it leads to segfault. > > That looks like a dangerous optimization to me. If that's the case, > doesn't it mean we have to make sure the address is always aligned > properly while calling memset? Above is just a side note. Anyway, I think making sure vq is cache aligned is good here. So, I will apply it. BTW, do you mind if I squash your 2 fixes into Huawei's Rx/Tx split commit? His commit is not pushed to upstream yet, therefore I can still do rebase: I'm thinking it's better to have one working commit other than one broken commit followed with several fixing commits. And of course, I will mention your contribution in the commit log. --yliu