From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from alln-iport-5.cisco.com (alln-iport-5.cisco.com [173.37.142.92]) by dpdk.org (Postfix) with ESMTP id 8398D37A2 for ; Sat, 30 May 2015 03:57:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2692; q=dns/txt; s=iport; t=1432951058; x=1434160658; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=LkuR3CKsvrm8k+sIeovHAC412DuP6nmn8l3qM31hCp0=; b=SAJMt00RldRZaNj8eWe6JNcNTXOIbYDSuIO4Sa3pzAT5S1bkylTK7qLd ArcuRNnMPf6vHvI7Xtm1vuSArjrdH7dNicxkI+9SBgnPVpyIpToQn/0qc sfoRYOxU4ZXyJKbsRdhE0nraNyt7ZsQoRhBDIXc3LTwPjEtKC5YfVuFsD Q=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AIBAChF2lV/4QNJK1cgxCBMga+JAmGQ4EOAoFFOBQBAQEBAQEBgQqEIwEBBCcTPxACAQgYHhAyJQIEAQ0FiC3UewEBAQEBAQEBAQEBAQEBAQEBAQEBAReLQ4UGB4QtAQSTCosSgSmOKYdgI2GDF2+BRoEBAQEB X-IronPort-AV: E=Sophos;i="5.13,521,1427760000"; d="scan'208";a="154717611" Received: from alln-core-10.cisco.com ([173.36.13.132]) by alln-iport-5.cisco.com with ESMTP; 30 May 2015 01:57:37 +0000 Received: from xhc-rcd-x12.cisco.com (xhc-rcd-x12.cisco.com [173.37.183.86]) by alln-core-10.cisco.com (8.14.5/8.14.5) with ESMTP id t4U1vbTA029226 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Sat, 30 May 2015 01:57:37 GMT Received: from xmb-rcd-x01.cisco.com ([169.254.1.227]) by xhc-rcd-x12.cisco.com ([173.37.183.86]) with mapi id 14.03.0195.001; Fri, 29 May 2015 20:57:36 -0500 From: "Andrew Harvey (agh)" To: Liang-Min Larry Wang , "dev@dpdk.org" Thread-Topic: [PATCH 1/2] ethdev: add api to set default mac address Thread-Index: AQHQmnDptbHXrbTI5EqapLu5PEKvKJ2ToZWA Date: Sat, 30 May 2015 01:57:37 +0000 Message-ID: References: <1432946276-9424-1-git-send-email-liang-min.wang@intel.com> <1432946276-9424-2-git-send-email-liang-min.wang@intel.com> In-Reply-To: <1432946276-9424-2-git-send-email-liang-min.wang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.5.0.150423 x-originating-ip: [10.24.6.246] Content-Type: text/plain; charset="us-ascii" Content-ID: <0C9D21511D5DE84B86BC3A7D3D6BAB07@emea.cisco.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 1/2] ethdev: add api to set default mac address 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: Sat, 30 May 2015 01:57:39 -0000 On 5/29/15, 5:37 PM, "Liang-Min Larry Wang" wrote: >add a new api: rte_eth_dev_default_mac_addr_set to >support changing default mac address of a NIC > >Signed-off-by: Liang-Min Larry Wang >--- > lib/librte_ether/rte_ethdev.c | 18 ++++++++++++++++++ > lib/librte_ether/rte_ethdev.h | 14 ++++++++++++++ > lib/librte_ether/rte_ether_version.map | 1 + > 3 files changed, 33 insertions(+) > >diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c >index 024fe8b..85ce72e 100644 >--- a/lib/librte_ether/rte_ethdev.c >+++ b/lib/librte_ether/rte_ethdev.c >@@ -2752,6 +2752,24 @@ rte_eth_dev_mac_addr_remove(uint8_t port_id, >struct ether_addr *addr) > } >=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; >+ } >+ >+ dev =3D &rte_eth_devices[port_id]; >+ FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mac_addr_set, -ENOTSUP); >+ >+ (*dev->dev_ops->mac_addr_set)(dev, addr); >+ >+ return 0; >+} >+ >+int > rte_eth_dev_set_vf_rxmode(uint8_t port_id, uint16_t vf, > uint16_t rx_mode, uint8_t on) > { >diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h >index 16dbe00..5f07e0d 100644 >--- a/lib/librte_ether/rte_ethdev.h >+++ b/lib/librte_ether/rte_ethdev.h >@@ -2982,6 +2982,20 @@ int rte_eth_dev_mac_addr_add(uint8_t port, struct >ether_addr *mac_addr, > int rte_eth_dev_mac_addr_remove(uint8_t port, struct ether_addr >*mac_addr); >=20 > /** >+ * Set the default MAC address. >+ * >+ * @param port >+ * The port identifier of the Ethernet device. >+ * @param mac_addr >+ * New default MAC address. >+ * @return >+ * - (0) if successful, or *mac_addr* didn't exist. >+ * - (-ENOTSUP) if hardware doesn't support. >+ * - (-ENODEV) if *port* invalid. >+ */ >+int rte_eth_dev_default_mac_addr_set(uint8_t port, struct ether_addr >*mac_addr); >+ >+/** > * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet >device. > * > * @param port >diff --git a/lib/librte_ether/rte_ether_version.map >b/lib/librte_ether/rte_ether_version.map >index a2d25a6..2dbbaa7 100644 >--- a/lib/librte_ether/rte_ether_version.map >+++ b/lib/librte_ether/rte_ether_version.map >@@ -102,6 +102,7 @@ DPDK_2.0 { > rte_eth_tx_queue_setup; > rte_eth_xstats_get; > rte_eth_xstats_reset; >+ rte_eth_dev_default_mac_addr_set; >=20 > local: *; > }; >--=20 >2.1.4 Acked-by: Andrew Harvey (agh)