From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Marchand Subject: [PATCH] virtio: fix size of mac_addrs array in virtio ports Date: Thu, 29 Oct 2015 09:46:15 +0100 Message-ID: <1446108375-14178-1-git-send-email-david.marchand@6wind.com> To: dev@dpdk.org Return-path: Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by dpdk.org (Postfix) with ESMTP id B10732E83 for ; Thu, 29 Oct 2015 09:46:24 +0100 (CET) Received: by wicll6 with SMTP id ll6so220961342wic.0 for ; Thu, 29 Oct 2015 01:46:24 -0700 (PDT) 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" From: Ivan Boule Make the virtio PMD allocate the array of unicast MAC addresses with the maximum of entries (VIRTIO_MAX_MAC_ADDRS) that it exports. Signed-off-by: Ivan Boule Signed-off-by: David Marchand --- drivers/net/virtio/virtio_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 12fcc23..79a97c3 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1175,11 +1175,11 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) } /* Allocate memory for storing MAC addresses */ - eth_dev->data->mac_addrs = rte_zmalloc("virtio", ETHER_ADDR_LEN, 0); + eth_dev->data->mac_addrs = rte_zmalloc("virtio", VIRTIO_MAX_MAC_ADDRS * ETHER_ADDR_LEN, 0); if (eth_dev->data->mac_addrs == NULL) { PMD_INIT_LOG(ERR, "Failed to allocate %d bytes needed to store MAC addresses", - ETHER_ADDR_LEN); + VIRTIO_MAX_MAC_ADDRS * ETHER_ADDR_LEN); return -ENOMEM; } -- 1.9.1