From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind_com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=4taLl6L/w9q3rydcEZoC7bmNIdH5Cix38um8JBUcVLw=; b=pGZW/w3uL0Ckm1aCLxIF4BjgQU+omqod7zk0kQMkAe+uosDsfWESsimHpc44GaWMyN RVUr7abhH5/QG7elyRFV9NCtjk4SlaOYwoRqPIZggkEpsHKWHziJg7VJOVYgooqGtnjS 5AHk2yuEg4Q5TeT2j3MFiCCT7oBfKylXnVDD+vUU3gRzbMQxOOvoDwQVhO4Y87IyMXfF FlofbDgb2uMLYHPg4U7VttwGj9GXI99SPJRcanmGGD/xOETCgxOyFsI8SHkxpKV4Zf17 0RlmJaqgevtZWXADSbT+xMhoFpMCoxBZkFDIdNXFsEQWEO7Nvx69zL5Vh6kUNUIB5ynf mL2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=4taLl6L/w9q3rydcEZoC7bmNIdH5Cix38um8JBUcVLw=; b=OAtiOxyuh7zCIonk2fY09L31c3IizdB3W5q3pRD1tRwYl0yYRO67iQNWStp9DFr7Jl w+imAtBicU1Rg/PACtMhX67EmUIAFLxSuGvCGv+ZkYVyL0DJzsNxPaXbwY/XvhwawCZB aeRirrq4kuvC55dxPEVVwmIXxHIGaAHd1LSxGiBYZipsPHzHZxCdPC8mQbnW4wJhHJrS 99KHSSxL77awX21YWNZxr3GMKNgs7sY6aYdb/SfTzDpw/WXeIYENAswyHPqfKDjhPBDt GQzJDxfZ0g7tvkLpwCA79HW3MduDIIyy6pq/SrAtikY9uxv08xgTq//oY8UxST2jHXe0 EPrA== X-Gm-Message-State: ALoCoQkjy8UGT/W0jindnq4citayL872cxZoTCbU9PDLQ+FVN88aYU9OETLQqiwtznuDG2o93gKC X-Received: by 10.28.24.73 with SMTP id 70mr4855446wmy.45.1446108384495; Thu, 29 Oct 2015 01:46:24 -0700 (PDT) Received: from gloops.dev.6wind.com (89-158-215-180.rev.numericable.fr. [89.158.215.180]) by smtp.gmail.com with ESMTPSA id w1sm578206wjz.37.2015.10.29.01.46.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Oct 2015 01:46:23 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Thu, 29 Oct 2015 09:46:15 +0100 Message-Id: <1446108375-14178-1-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH] virtio: fix size of mac_addrs array in virtio ports 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: Thu, 29 Oct 2015 08:46:24 -0000 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