From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id BFE212BC3 for ; Mon, 13 Jun 2016 12:24:38 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 13 Jun 2016 03:24:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,466,1459839600"; d="scan'208";a="996463314" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga002.jf.intel.com with ESMTP; 13 Jun 2016 03:24:36 -0700 Date: Mon, 13 Jun 2016 18:26:35 +0800 From: Yuanhan Liu To: "Tan, Jianfeng" Cc: "dev@dpdk.org" , "Xie, Huawei" Message-ID: <20160613102635.GU10038@yliu-dev.sh.intel.com> References: <1465741782-126976-1-git-send-email-jianfeng.tan@intel.com> <20160613092101.GN10038@yliu-dev.sh.intel.com> <20160613095146.GP10038@yliu-dev.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] virtio: fix allocating virtnet_rx not mem aligned X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 10:24:39 -0000 On Mon, Jun 13, 2016 at 10:06:22AM +0000, Tan, Jianfeng wrote: > > > > -----Original Message----- > > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > > Sent: Monday, June 13, 2016 5:52 PM > > To: Tan, Jianfeng > > Cc: dev@dpdk.org; Xie, Huawei > > Subject: Re: [dpdk-dev] [PATCH] virtio: fix allocating virtnet_rx not mem > > aligned > > > > 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. > > Not a problem from my side. But Huawei seems to have concerns on this fix. You can do that for the other fix firstly. What's the concern? Despite the clang issue (I still have no idea why clang would go that aggressively), I think making vq cache aligned is generically a good idea. --yliu