ethdev: fix build without hotplug
authorThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 26 Feb 2015 10:46:52 +0000 (11:46 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 26 Feb 2015 10:55:10 +0000 (11:55 +0100)
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 <stephen@networkplumber.org>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
lib/librte_ether/rte_ethdev.c

index 7a54600..bb94ccb 100644 (file)
@@ -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)