]> git.droids-corp.org - dpdk.git/commitdiff
eal: enable port hotplug as default for linux and bsd
authorTetsuya Mukawa <mukawa@igel.co.jp>
Tue, 30 Jun 2015 08:26:51 +0000 (17:26 +0900)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 8 Jul 2015 22:18:25 +0000 (00:18 +0200)
This patch removes CONFIG_RTE_LIBRTE_EAL_HOTPLUG option, and enables it
as default in both Linux and BSD.
Also, to support port hotplug, rte_eal_pci_scan() and below missing
symbols should be exported to ethdev library.
 - rte_eal_parse_devargs_str()
 - rte_eal_pci_close_one()
 - rte_eal_pci_probe_one()
 - rte_eal_pci_scan()
 - rte_eal_vdev_init()
 - rte_eal_vdev_uninit()

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
config/common_bsdapp
config/common_linuxapp
lib/librte_eal/bsdapp/eal/eal_pci.c
lib/librte_eal/bsdapp/eal/rte_eal_version.map
lib/librte_eal/common/eal_common_dev.c
lib/librte_eal/common/eal_common_pci.c
lib/librte_eal/common/eal_common_pci_uio.c
lib/librte_eal/common/eal_private.h
lib/librte_eal/common/include/rte_pci.h
lib/librte_ether/rte_ethdev.c

index 78754b25dce9305b6a6ad7dfef62893e1cbd6957..1f5d1cfbd80f8eb6cfbc09e59af89f1142d2c696 100644 (file)
@@ -120,12 +120,6 @@ CONFIG_RTE_LIBRTE_EAL_BSDAPP=y
 #
 CONFIG_RTE_LIBRTE_EAL_LINUXAPP=n
 
-#
-# Compile Environment Abstraction Layer to support hotplug
-# So far, Hotplug functions only support linux
-#
-CONFIG_RTE_LIBRTE_EAL_HOTPLUG=n
-
 #
 # Compile Environment Abstraction Layer to support Vmware TSC map
 #
index f5646e0d966503e3bc67a3f077e9dc71bba96c5c..7a54ff8f38555f47a9d4c3a6768679a17a921578 100644 (file)
@@ -118,11 +118,6 @@ CONFIG_RTE_PCI_MAX_READ_REQUEST_SIZE=0
 #
 CONFIG_RTE_LIBRTE_EAL_LINUXAPP=y
 
-#
-# Compile Environment Abstraction Layer to support hotplug
-#
-CONFIG_RTE_LIBRTE_EAL_HOTPLUG=y
-
 #
 # Compile Environment Abstraction Layer to support Vmware TSC map
 #
index 761c2f315a5976aa7f4138f22341917b9629ee01..12f39d989fdb7ed982d0c49c5d75c2603808c6b2 100644 (file)
@@ -312,8 +312,8 @@ skipdev:
  * Scan the content of the PCI bus, and add the devices in the devices
  * list. Call pci_scan_one() for each pci entry found.
  */
-static int
-pci_scan(void)
+int
+rte_eal_pci_scan(void)
 {
        int fd;
        unsigned dev_count = 0;
@@ -369,7 +369,7 @@ rte_eal_pci_init(void)
        if (internal_config.no_pci)
                return 0;
 
-       if (pci_scan() < 0) {
+       if (rte_eal_pci_scan() < 0) {
                RTE_LOG(ERR, EAL, "%s(): Cannot scan PCI bus\n", __func__);
                return -1;
        }
index 67b6a6c7ce12f9a4422422ed9dcf30d2002b00b7..7e850a9bf23c8678043f141668d61adab39b5a3d 100644 (file)
@@ -37,14 +37,20 @@ DPDK_2.0 {
        rte_eal_lcore_role;
        rte_eal_mp_remote_launch;
        rte_eal_mp_wait_lcore;
+       rte_eal_parse_devargs_str;
+       rte_eal_pci_close_one;
        rte_eal_pci_dump;
        rte_eal_pci_probe;
+       rte_eal_pci_probe_one;
        rte_eal_pci_register;
+       rte_eal_pci_scan;
        rte_eal_pci_unregister;
        rte_eal_process_type;
        rte_eal_remote_launch;
        rte_eal_tailq_lookup;
        rte_eal_tailq_register;
+       rte_eal_vdev_init;
+       rte_eal_vdev_uninit;
        rte_eal_wait_lcore;
        rte_exit;
        rte_get_hpet_cycles;
index 92a5a941848e291dfa2244f181cdf0cb47518ba6..4089d6623e51cb79a26083e8f4a89ec2db8fd629 100644 (file)
@@ -125,7 +125,6 @@ rte_eal_dev_init(void)
        return 0;
 }
 
-#ifdef RTE_LIBRTE_EAL_HOTPLUG
 int
 rte_eal_vdev_uninit(const char *name)
 {
@@ -151,4 +150,3 @@ rte_eal_vdev_uninit(const char *name)
        RTE_LOG(ERR, EAL, "no driver found for %s\n", name);
        return -EINVAL;
 }
-#endif /* RTE_LIBRTE_EAL_HOTPLUG */
index 8ef805736d6f1766c2e2922357f368aeb2c64095..3805aed5e70251d4e511839c5a869f6189590d7f 100644 (file)
@@ -167,7 +167,6 @@ pci_map_device(struct rte_pci_device *dev)
        return ret;
 }
 
-#ifdef RTE_LIBRTE_EAL_HOTPLUG
 /* Unmap pci device */
 static void
 pci_unmap_device(struct rte_pci_device *dev)
@@ -192,7 +191,6 @@ pci_unmap_device(struct rte_pci_device *dev)
                break;
        }
 }
-#endif /* RTE_LIBRTE_EAL_HOTPLUG */
 
 /*
  * If vendor/device ID match, call the devinit() function of the
@@ -265,7 +263,6 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d
        return 1;
 }
 
-#ifdef RTE_LIBRTE_EAL_HOTPLUG
 /*
  * If vendor/device ID match, call the devuninit() function of the
  * driver.
@@ -321,7 +318,6 @@ rte_eal_pci_close_one_driver(struct rte_pci_driver *dr,
        /* return positive value if driver is not found */
        return 1;
 }
-#endif /* RTE_LIBRTE_EAL_HOTPLUG */
 
 /*
  * If vendor/device ID match, call the devinit() function of all
@@ -350,7 +346,6 @@ pci_probe_all_drivers(struct rte_pci_device *dev)
        return 1;
 }
 
-#ifdef RTE_LIBRTE_EAL_HOTPLUG
 /*
  * If vendor/device ID match, call the devuninit() function of all
  * registered driver for the given device. Return -1 if initialization
@@ -441,7 +436,6 @@ err_return:
                        dev->addr.devid, dev->addr.function);
        return -1;
 }
-#endif /* RTE_LIBRTE_EAL_HOTPLUG */
 
 /*
  * Scan the content of the PCI bus, and call the devinit() function for
index 2abed93646eb0291bf363450dad31a9d69f98dd8..f062e81d373bad8dbb30c47ce9512ed422bd2899 100644 (file)
@@ -148,7 +148,6 @@ error:
        return -1;
 }
 
-#ifdef RTE_LIBRTE_EAL_HOTPLUG
 static void
 pci_uio_unmap(struct mapped_pci_resource *uio_res)
 {
@@ -221,4 +220,3 @@ pci_uio_unmap_resource(struct rte_pci_device *dev)
        dev->intr_handle.fd = -1;
        dev->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN;
 }
-#endif /* RTE_LIBRTE_EAL_HOTPLUG */
index 4aa18815d861e5cc5574a854b763fd5ff89c3d3d..e16bb68c84121885b986e632d132572ba3a6fcf2 100644 (file)
@@ -174,14 +174,12 @@ int pci_unbind_kernel_driver(struct rte_pci_device *dev);
  */
 int pci_uio_map_resource(struct rte_pci_device *dev);
 
-#ifdef RTE_LIBRTE_EAL_HOTPLUG
 /**
  * Unmap the PCI resource of a PCI device
  *
  * This function is private to EAL.
  */
 void pci_uio_unmap_resource(struct rte_pci_device *dev);
-#endif /* RTE_LIBRTE_EAL_HOTPLUG */
 
 /**
  * Allocate uio resource for PCI device
index 6f80b19f12f42a9111680d36404bea52ed467fbc..e96f389f937069b0917667dc151966a6735c946c 100644 (file)
@@ -397,7 +397,6 @@ void *pci_map_resource(void *requested_addr, int fd, off_t offset,
  */
 void pci_unmap_resource(void *requested_addr, size_t size);
 
-#ifdef RTE_LIBRTE_EAL_HOTPLUG
 /**
  * Probe the single PCI device.
  *
@@ -427,7 +426,6 @@ int rte_eal_pci_probe_one(const struct rte_pci_addr *addr);
  *   - Negative on error.
  */
 int rte_eal_pci_close_one(const struct rte_pci_addr *addr);
-#endif /* RTE_LIBRTE_EAL_HOTPLUG */
 
 /**
  * Dump the content of the PCI bus.
index 7c133ef0cebfcf579fe66effe0c7424330ff10ee..44d41b83988e02963d646decf47c8d12fc9c6db7 100644 (file)
@@ -443,9 +443,6 @@ 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)
 {
@@ -720,24 +717,6 @@ rte_eth_dev_detach(uint8_t port_id, char *name)
        } else
                return rte_eth_dev_detach_vdev(port_id, name);
 }
-#else /* RTE_LIBRTE_EAL_HOTPLUG */
-int
-rte_eth_dev_attach(const char *devargs __rte_unused,
-                       uint8_t *port_id __rte_unused)
-{
-       RTE_LOG(ERR, EAL, "Hotplug support isn't enabled\n");
-       return -1;
-}
-
-/* detach the device, then store the name of the device */
-int
-rte_eth_dev_detach(uint8_t port_id __rte_unused,
-                       char *name __rte_unused)
-{
-       RTE_LOG(ERR, EAL, "Hotplug support isn't enabled\n");
-       return -1;
-}
-#endif /* RTE_LIBRTE_EAL_HOTPLUG */
 
 static int
 rte_eth_dev_rx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues)