From mboxrd@z Thu Jan 1 00:00:00 1970 From: Liang-Min Larry Wang Subject: [PATCH v16 5/6] ethdev: change api name, version information and fix macro Date: Tue, 14 Jul 2015 09:11:55 -0400 Message-ID: <1436879516-8136-6-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 To: dev@dpdk.org 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) In-Reply-To: <1436879516-8136-1-git-send-email-liang-min.wang@intel.com> 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" 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