From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f169.google.com (mail-ig0-f169.google.com [209.85.213.169]) by dpdk.org (Postfix) with ESMTP id 6682FC628 for ; Thu, 25 Jun 2015 15:39:49 +0200 (CEST) Received: by igcsj18 with SMTP id sj18so8583137igc.1 for ; Thu, 25 Jun 2015 06:39:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=/iSJSDSqVNbHRxy6NtKLUxvp32JAprUm0mQUDOUg8yc=; b=bOnbaNtbbVbblP8eOmXo8h0mV08LPh5Z8xR46odeL2+H+C0oQkPp6NoBC4tb9tRO1r dXGBFelTKDwYj7O990e5+4JI/fpolgmp9h6HcNw4EMlB+/NucXaAJ8JfOlSuvkOEqGsQ UtZ1AnSs6ax0kKj1rz4+m7ZnbTVuCOzoeSyl01t9MvGt9TYo5K2pPvA1KhNDh7Io+Wab nJoTa75u6hlbk/eoXfOeCbEL5/khkA/5VXy8nA2cJGfTyrG1T12ldRPnakW37htsVZXw 1GxzLGfZLRNOLOr1f7JGeSbfOHAIy5bc1B7fHlU8D84//sgRkWAod4GsvoBEoTYGDcfb gx3w== X-Gm-Message-State: ALoCoQkYrIwugth7GwfGfS6n3oX9beoVSL38EgB67mdGAhcdvVPFREzn1Eh58kYzyIT1ih1+N4Lm X-Received: by 10.43.92.199 with SMTP id br7mr43962952icc.43.1435239588819; Thu, 25 Jun 2015 06:39:48 -0700 (PDT) Received: from uryu.home.lan ([144.160.5.83]) by mx.google.com with ESMTPSA id z195sm19615191iod.33.2015.06.25.06.39.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jun 2015 06:39:48 -0700 (PDT) Date: Thu, 25 Jun 2015 09:39:45 -0400 From: Stephen Hemminger To: Liang-Min Larry Wang Message-ID: <20150625093945.53cae1e1@uryu.home.lan> In-Reply-To: <1434579735-15496-2-git-send-email-liang-min.wang@intel.com> References: <1432946276-9424-1-git-send-email-liang-min.wang@intel.com> <1434579735-15496-1-git-send-email-liang-min.wang@intel.com> <1434579735-15496-2-git-send-email-liang-min.wang@intel.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v7 1/4] ethdev: add apis to support access device info 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, 25 Jun 2015 13:39:49 -0000 On Wed, 17 Jun 2015 18:22:12 -0400 Liang-Min Larry Wang wrote: > int > +rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr) > +{ > + struct rte_eth_dev *dev; > + > + if (!rte_eth_dev_is_valid_port(port_id)) { > + PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); > + return -ENODEV; > + } > + > + if (!is_valid_assigned_ether_addr(addr)) > + return -EINVAL; > + > + dev = &rte_eth_devices[port_id]; > + FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mac_addr_set, -ENOTSUP); > + > + /* Update default address in NIC data structure */ > + ether_addr_copy(addr, &dev->data->mac_addrs[0]); > + > + (*dev->dev_ops->mac_addr_set)(dev, addr); Would it be possible to directly set mac_addr[0] if device does not provide a device driver specific override?