From 7609e6609350b6a5884578b108a79a39bc3bd020 Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Thu, 26 Feb 2015 11:46:52 +0100 Subject: [PATCH] ethdev: fix build without hotplug MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit After setting CONFIG_RTE_LIBRTE_EAL_HOTPLUG=n, GCC stop compiling: rte_ethdev.c:430:1: error: ‘rte_eth_dev_get_device_type’ defined but not used rte_ethdev.c:438:1: error: ‘rte_eth_dev_save’ defined but not used rte_ethdev.c:450:1: error: ‘rte_eth_dev_get_changed_port’ defined but not used rte_ethdev.c:464:1: error: ‘rte_eth_dev_get_addr_by_port’ defined but not used rte_ethdev.c:481:1: error: ‘rte_eth_dev_get_name_by_port’ defined but not used rte_ethdev.c:503:1: error: ‘rte_eth_dev_is_detachable’ defined but not used The hotplug option allows to build in environment (BSD) not yet supported by this new feature. It should be removed when BSD will be supported. Waiting this day, let's fix build with hotplug disabled. Reported-by: Stephen Hemminger Signed-off-by: Thomas Monjalon --- lib/librte_ether/rte_ethdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 7a546005f9..bb94ccb954 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -426,6 +426,9 @@ rte_eth_dev_count(void) return (nb_ports); } +/* So far, DPDK hotplug function only supports linux */ +#ifdef RTE_LIBRTE_EAL_HOTPLUG + static enum rte_eth_dev_type rte_eth_dev_get_device_type(uint8_t port_id) { @@ -524,8 +527,6 @@ rte_eth_dev_is_detachable(uint8_t port_id) return !(drv_flags & RTE_PCI_DRV_DETACHABLE); } -/* So far, DPDK hotplug function only supports linux */ -#ifdef RTE_LIBRTE_EAL_HOTPLUG /* attach the new physical device, then store port_id of the device */ static int rte_eth_dev_attach_pdev(struct rte_pci_addr *addr, uint8_t *port_id) -- 2.20.1