From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: [PATCH] net: virtio: clear reserved vring properly at setup time Date: Mon, 18 Jul 2016 19:09:24 +0200 Message-ID: <1468861764-22197-1-git-send-email-maxime.coquelin@redhat.com> Cc: dev@dpdk.org, Maxime Coquelin To: huawei.xie@intel.com, yuanhan.liu@linux.intel.com Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id D352F19F5 for ; Mon, 18 Jul 2016 19:09:34 +0200 (CEST) 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" 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, it is not a fix for a problem I encountered. --- 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); vq->vq_ring_mem = mz->phys_addr; vq->vq_ring_virt_mem = mz->addr; -- 2.7.4