From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 56E915A96 for ; Tue, 14 Jul 2015 15:13:43 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 14 Jul 2015 06:12:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,471,1432623600"; d="scan'208";a="746889136" Received: from jcyip-mobl3.amr.corp.intel.com (HELO lwang14-MOBL6.amr.corp.intel.com) ([10.254.232.144]) by fmsmga001.fm.intel.com with ESMTP; 14 Jul 2015 06:12:09 -0700 From: Liang-Min Larry Wang To: dev@dpdk.org Date: Tue, 14 Jul 2015 09:11:55 -0400 Message-Id: <1436879516-8136-6-git-send-email-liang-min.wang@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1436879516-8136-1-git-send-email-liang-min.wang@intel.com> References: <1432946276-9424-1-git-send-email-liang-min.wang@intel.com> <1436879516-8136-1-git-send-email-liang-min.wang@intel.com> Cc: Liang-Min Larry Wang Subject: [dpdk-dev] [PATCH v16 5/6] ethdev: change api name, version information and fix macro 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: Tue, 14 Jul 2015 13:13:44 -0000 I. change api name with "get" - rte_eth_dev_get_reg_length - rte_eth_dev_get_reg_info - rte_eth_dev_get_eeprom_length II. fix unused variable in VALID_PORTID_OR_ERR_RET III. use VALID_PORTID_OR_ERR_RET instead of rte_eth_dev_is_valid_port and III. move new api name to version 2.1 list Signed-off-by: Liang-Min Larry Wang --- lib/librte_ether/rte_ethdev.c | 13 +++++-------- lib/librte_ether/rte_ethdev.h | 6 +++--- lib/librte_ether/rte_ether_version.map | 12 ++++++------ 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 6423c3c..c47b91f 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -111,7 +111,7 @@ #define VALID_PORTID_OR_ERR_RET(port_id, retval) do { \ if (!rte_eth_dev_is_valid_port(port_id)) { \ PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); \ - return -EINVAL; \ + return retval; \ } \ } while (0) @@ -2546,10 +2546,7 @@ 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; - } + VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); if (!is_valid_assigned_ether_addr(addr)) return -EINVAL; @@ -3403,7 +3400,7 @@ rte_eth_timesync_read_tx_timestamp(uint8_t port_id, struct timespec *timestamp) } int -rte_eth_dev_reg_length(uint8_t port_id) +rte_eth_dev_get_reg_length(uint8_t port_id) { struct rte_eth_dev *dev; @@ -3415,7 +3412,7 @@ rte_eth_dev_reg_length(uint8_t port_id) } int -rte_eth_dev_reg_info(uint8_t port_id, struct rte_dev_reg_info *info) +rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info) { struct rte_eth_dev *dev; @@ -3427,7 +3424,7 @@ rte_eth_dev_reg_info(uint8_t port_id, struct rte_dev_reg_info *info) } int -rte_eth_dev_eeprom_length(uint8_t port_id) +rte_eth_dev_get_eeprom_length(uint8_t port_id) { struct rte_eth_dev *dev; diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 470c2b5..cd4666d 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -3710,7 +3710,7 @@ int rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_reg_length(uint8_t port_id); +int rte_eth_dev_get_reg_length(uint8_t port_id); /** * Retrieve device registers and register attributes @@ -3725,7 +3725,7 @@ int rte_eth_dev_reg_length(uint8_t port_id); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_reg_info(uint8_t port_id, struct rte_dev_reg_info *info); +int rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info); /** * Retrieve size of device EEPROM @@ -3738,7 +3738,7 @@ int rte_eth_dev_reg_info(uint8_t port_id, struct rte_dev_reg_info *info); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_eeprom_length(uint8_t port_id); +int rte_eth_dev_get_eeprom_length(uint8_t port_id); /** * Retrieve EEPROM and EEPROM attribute diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map index 290b206..72eacca 100644 --- a/lib/librte_ether/rte_ether_version.map +++ b/lib/librte_ether/rte_ether_version.map @@ -102,12 +102,6 @@ DPDK_2.0 { rte_eth_tx_queue_setup; rte_eth_xstats_get; rte_eth_xstats_reset; - rte_eth_dev_default_mac_addr_set; - rte_eth_dev_reg_length; - rte_eth_dev_reg_info; - rte_eth_dev_eeprom_length; - rte_eth_dev_get_eeprom; - rte_eth_dev_set_eeprom; local: *; }; @@ -120,5 +114,11 @@ DPDK_2.1 { rte_eth_timesync_enable; rte_eth_timesync_read_rx_timestamp; rte_eth_timesync_read_tx_timestamp; + rte_eth_dev_default_mac_addr_set; + rte_eth_dev_get_reg_length; + rte_eth_dev_get_reg_info; + rte_eth_dev_get_eeprom_length; + rte_eth_dev_get_eeprom; + rte_eth_dev_set_eeprom; } DPDK_2.0; -- 2.1.4