From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Wang, Liang-min" Subject: Re: [PATCH v7 1/4] ethdev: add apis to support access device info Date: Thu, 25 Jun 2015 20:58:15 +0000 Message-ID: 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> <20150625093945.53cae1e1@uryu.home.lan> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" To: Stephen Hemminger , "Ananyev, Konstantin" Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 911F1C71E for ; Thu, 25 Jun 2015 22:58:18 +0200 (CEST) In-Reply-To: <20150625093945.53cae1e1@uryu.home.lan> Content-Language: en-US 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" > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Thursday, June 25, 2015 9:40 AM > To: Wang, Liang-min > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v7 1/4] ethdev: add apis to support access > device info >=20 > On Wed, 17 Jun 2015 18:22:12 -0400 > Liang-Min Larry Wang wrote: >=20 > > 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=3D%d\n", port_id); > > + return -ENODEV; > > + } > > + > > + if (!is_valid_assigned_ether_addr(addr)) > > + return -EINVAL; > > + > > + dev =3D &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); >=20 > Would it be possible to directly set mac_addr[0] if device does not > provide a device driver specific override? I would yield this question to Konstantin since this information is used by= get mac addr API.