From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 25 Jun 2015 13:58:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,679,1427785200"; d="scan'208";a="753322988" Received: from orsmsx105.amr.corp.intel.com ([10.22.225.132]) by orsmga002.jf.intel.com with ESMTP; 25 Jun 2015 13:58:17 -0700 Received: from orsmsx161.amr.corp.intel.com (10.22.240.84) by ORSMSX105.amr.corp.intel.com (10.22.225.132) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 25 Jun 2015 13:58:17 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by ORSMSX161.amr.corp.intel.com (10.22.240.84) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 25 Jun 2015 13:58:17 -0700 Received: from FMSMSX110.amr.corp.intel.com ([169.254.14.199]) by fmsmsx117.amr.corp.intel.com ([169.254.3.141]) with mapi id 14.03.0224.002; Thu, 25 Jun 2015 13:58:16 -0700 From: "Wang, Liang-min" To: Stephen Hemminger , "Ananyev, Konstantin" Thread-Topic: [dpdk-dev] [PATCH v7 1/4] ethdev: add apis to support access device info Thread-Index: AQHQqUwVozUIsvKkqUKmtYbRXAZvJJ29u4uAgAAElvA= 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> In-Reply-To: <20150625093945.53cae1e1@uryu.home.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.1.200.108] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 20:58:19 -0000 > -----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.