From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH 1/2] szedata2: new poll mode driver Date: Mon, 21 Mar 2016 10:45:08 -0700 Message-ID: <20160321104508.2a318a69@xeon-e3> References: <1434702301-4509-1-git-send-email-vido@cesnet.cz> <1434702301-4509-2-git-send-email-vido@cesnet.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Matej Vido Return-path: Received: from mail-pf0-f172.google.com (mail-pf0-f172.google.com [209.85.192.172]) by dpdk.org (Postfix) with ESMTP id 325732C05 for ; Mon, 21 Mar 2016 18:44:53 +0100 (CET) Received: by mail-pf0-f172.google.com with SMTP id x3so272682634pfb.1 for ; Mon, 21 Mar 2016 10:44:53 -0700 (PDT) In-Reply-To: <1434702301-4509-2-git-send-email-vido@cesnet.cz> 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" On Fri, 19 Jun 2015 10:25:00 +0200 Matej Vido wrote: > +static struct ether_addr eth_addr = { > + .addr_bytes = { 0, 0, 0, 0x1, 0x2, 0x3 } > +}; ... > static int > rte_szedata2_eth_dev_init(struct rte_eth_dev *dev) > { .. > /* Allocate space for one mac address */ > data->mac_addrs = rte_zmalloc(data->name, sizeof(struct ether_addr), > RTE_CACHE_LINE_SIZE); > if (data->mac_addrs == NULL) { > RTE_LOG(ERR, PMD, "Could not alloc space for MAC address!\n"); > munmap(dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].addr, > dev->pci_dev->mem_resource[PCI_RESOURCE_NUMBER].len); > return -EINVAL; > } > > ether_addr_copy(ð_addr, data->mac_addrs); If your hardware has no permanent MAC address, then please use eth_random_addr() to make one on boot, rather than having a bogus static value.