Message ID | 1468861764-22197-1-git-send-email-maxime.coquelin@redhat.com (mailing list archive) |
---|---|
State | Changes Requested, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 6D0B82C01; Mon, 18 Jul 2016 19:09:36 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id D352F19F5 for <dev@dpdk.org>; Mon, 18 Jul 2016 19:09:34 +0200 (CEST) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 11AD33D1EC; Mon, 18 Jul 2016 17:09:34 +0000 (UTC) Received: from max-t460s.redhat.com (vpn1-4-89.ams2.redhat.com [10.36.4.89]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6IH9WLX013255; Mon, 18 Jul 2016 13:09:32 -0400 From: Maxime Coquelin <maxime.coquelin@redhat.com> To: huawei.xie@intel.com, yuanhan.liu@linux.intel.com Cc: dev@dpdk.org, Maxime Coquelin <maxime.coquelin@redhat.com> Date: Mon, 18 Jul 2016 19:09:24 +0200 Message-Id: <1468861764-22197-1-git-send-email-maxime.coquelin@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 18 Jul 2016 17:09:34 +0000 (UTC) Subject: [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 <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Maxime Coquelin
July 18, 2016, 5:09 p.m. UTC
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 <maxime.coquelin@redhat.com>
---
Note: I found this bug while doing some code review, it is not a fix for
a problem I encountered.
---
drivers/net/virtio/virtio_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
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 <maxime.coquelin@redhat.com> > --- > > 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
On 07/19/2016 03:39 AM, Yuanhan Liu wrote: > 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 <maxime.coquelin@redhat.com> >> --- >> >> 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(). Ok, thanks for the pointer. > >> --- >> 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. We can skip this patch then. > > And to Thomas, I don't find a good reason to have this in 16.07. Let's > delay the apply to v16.11. Yes, that's why I mentioned it didn't fixed any problem on my side. So I propose we skip this patch, I'll resend one removing the memset for v16.11. Thanks, Maxime > > --yliu > >> vq->vq_ring_mem = mz->phys_addr; >> vq->vq_ring_virt_mem = mz->addr; >> -- >> 2.7.4
On Tue, Jul 19, 2016 at 07:31:35AM +0200, Maxime Coquelin wrote: > >And to Thomas, I don't find a good reason to have this in 16.07. Let's > >delay the apply to v16.11. > Yes, that's why I mentioned it didn't fixed any problem on my side. > > So I propose we skip this patch, I'll resend one removing the memset for > v16.11. Good to me. --yliu
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); vq->vq_ring_mem = mz->phys_addr; vq->vq_ring_virt_mem = mz->addr;