From: Thomas Monjalon Date: Thu, 26 Feb 2015 10:46:52 +0000 (+0100) Subject: ethdev: fix build without hotplug X-Git-Tag: spdx-start~9522 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7609e6609350b6a5884578b108a79a39bc3bd020;p=dpdk.git ethdev: fix build without hotplug 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 --- 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)