From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 6EBA82B98 for ; Tue, 19 Jul 2016 03:35:52 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 18 Jul 2016 18:35:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,387,1464678000"; d="scan'208";a="848831815" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga003.jf.intel.com with ESMTP; 18 Jul 2016 18:35:50 -0700 Date: Tue, 19 Jul 2016 09:39:34 +0800 From: Yuanhan Liu To: Maxime Coquelin Cc: huawei.xie@intel.com, dev@dpdk.org, Thomas Monjalon Message-ID: <20160719013934.GI5146@yliu-dev.sh.intel.com> References: <1468861764-22197-1-git-send-email-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1468861764-22197-1-git-send-email-maxime.coquelin@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] net: virtio: clear reserved vring properly at setup time 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: Tue, 19 Jul 2016 01:35:52 -0000 On Mon, Jul 18, 2016 at 07:09:24PM +0200, Maxime Coquelin wrote: > After vring reservation, only the first bytes of the vring were > cleared. > > This patch fixes this to clear the real size fo the vring. > > Signed-off-by: Maxime Coquelin > --- > > Note: I found this bug while doing some code review, Nice catch! > it is not a fix for > a problem I encountered. Yes, there should be no problem: vring memory is completely zero-ed at port start stage by virtio_dev_vring_start(). > --- > drivers/net/virtio/virtio_ethdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c > index 850e3ba..336b3fc 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -387,7 +387,7 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev, > } > } > > - memset(mz->addr, 0, sizeof(mz->len)); > + memset(mz->addr, 0, mz->len); Actually, I think we could simply drop the memset here. It's redundant, as stated. And to Thomas, I don't find a good reason to have this in 16.07. Let's delay the apply to v16.11. --yliu > vq->vq_ring_mem = mz->phys_addr; > vq->vq_ring_virt_mem = mz->addr; > -- > 2.7.4