From: Neil Horman Date: Mon, 21 Apr 2014 14:59:39 +0000 (-0400) Subject: ethdev: remove rte_pmd_init_all function X-Git-Tag: spdx-start~10804 X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=e5ffdd1457c0fb4e8365f524ee2529ac726edcf3 ethdev: remove rte_pmd_init_all function Now that we've converted all the pmds in dpdk to use the driver registration macro, rte_pmd_init_all has become empty. As theres no reason to keep it around anymore, just remove it and fix up all the eample callers. Signed-off-by: Neil Horman Acked-by: Thomas Monjalon --- diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index bb4972c38f..bc3830520c 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1806,9 +1806,6 @@ main(int argc, char** argv) if (diag < 0) rte_panic("Cannot init EAL\n"); - if (rte_pmd_init_all()) - rte_panic("Cannot init PMD\n"); - if (rte_eal_pci_probe()) rte_panic("Cannot probe PCI\n"); diff --git a/app/test/test_kni.c b/app/test/test_kni.c index e0fe44ef35..d37758bbce 100644 --- a/app/test/test_kni.c +++ b/app/test/test_kni.c @@ -509,11 +509,6 @@ test_kni(void) printf("fail to create mempool for kni\n"); return -1; } - ret = rte_pmd_init_all(); - if (ret < 0) { - printf("fail to initialize PMD\n"); - return -1; - } ret = rte_eal_pci_probe(); if (ret < 0) { printf("fail to probe PCI devices\n"); diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c index 0bc149dacc..d73b413344 100644 --- a/examples/exception_path/main.c +++ b/examples/exception_path/main.c @@ -566,11 +566,6 @@ main(int argc, char** argv) return -1; } - /* Initialise PMD driver(s) */ - ret = rte_pmd_init_all(); - if (ret < 0) - FATAL_ERROR("Could not probe PMD (%d)", ret); - /* Scan PCI bus for recognised devices */ ret = rte_eal_pci_probe(); if (ret < 0) diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index 4880a5f595..bafa8d95d7 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -1553,10 +1553,6 @@ MAIN(int argc, char **argv) rte_exit(EXIT_FAILURE, "init_lcore_rx_queues failed\n"); - /* init driver(s) */ - if (rte_pmd_init_all() < 0) - rte_exit(EXIT_FAILURE, "Cannot init pmd\n"); - if (rte_eal_pci_probe() < 0) rte_exit(EXIT_FAILURE, "Cannot probe PCI\n"); diff --git a/examples/ipv4_frag/main.c b/examples/ipv4_frag/main.c index 93664c878b..329f2ce112 100644 --- a/examples/ipv4_frag/main.c +++ b/examples/ipv4_frag/main.c @@ -608,10 +608,6 @@ MAIN(int argc, char **argv) if (pool_indirect == NULL) rte_panic("Cannot init indirect mbuf pool\n"); - /* init driver */ - if (rte_pmd_init_all() < 0) - rte_panic("Cannot init PMD\n"); - if (rte_eal_pci_probe() < 0) rte_panic("Cannot probe PCI\n"); diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c index 3bd37e4814..da4e09dba0 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -753,10 +753,6 @@ MAIN(int argc, char **argv) if (clone_pool == NULL) rte_exit(EXIT_FAILURE, "Cannot init clone mbuf pool\n"); - /* init driver */ - if (rte_pmd_init_all() < 0) - rte_exit(EXIT_FAILURE, "Cannot init pmd\n"); - if (rte_eal_pci_probe() < 0) rte_exit(EXIT_FAILURE, "Cannot probe PCI\n"); diff --git a/examples/kni/main.c b/examples/kni/main.c index 274990b319..fe823b34d3 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -889,11 +889,6 @@ main(int argc, char** argv) return -1; } - /* Initialise PMD driver(s) */ - ret = rte_pmd_init_all(); - if (ret < 0) - rte_exit(EXIT_FAILURE, "Could not initialise PMD (%d)\n", ret); - /* Scan PCI bus for recognised devices */ ret = rte_eal_pci_probe(); if (ret < 0) diff --git a/examples/l2fwd-ivshmem/host/host.c b/examples/l2fwd-ivshmem/host/host.c index 8aec7740af..75eae0e8c5 100644 --- a/examples/l2fwd-ivshmem/host/host.c +++ b/examples/l2fwd-ivshmem/host/host.c @@ -716,10 +716,6 @@ int main(int argc, char **argv) if (l2fwd_ivshmem_pktmbuf_pool == NULL) rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n"); - /* init driver(s) */ - if (rte_pmd_init_all() < 0) - rte_exit(EXIT_FAILURE, "Cannot init pmd\n"); - if (rte_eal_pci_probe() < 0) rte_exit(EXIT_FAILURE, "Cannot probe PCI\n"); diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index 2d94366613..d04e27abd6 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -615,10 +615,6 @@ MAIN(int argc, char **argv) if (l2fwd_pktmbuf_pool == NULL) rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n"); - /* init driver(s) */ - if (rte_pmd_init_all() < 0) - rte_exit(EXIT_FAILURE, "Cannot init pmd\n"); - if (rte_eal_pci_probe() < 0) rte_exit(EXIT_FAILURE, "Cannot probe PCI\n"); diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 219f802cd1..598b7a249e 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -1547,10 +1547,6 @@ MAIN(int argc, char **argv) rte_exit(EXIT_FAILURE, "init_lcore_rx_queues failed\n"); - /* init driver(s) */ - if (rte_pmd_init_all() < 0) - rte_exit(EXIT_FAILURE, "Cannot init pmd\n"); - if (rte_eal_pci_probe() < 0) rte_exit(EXIT_FAILURE, "Cannot probe PCI\n"); diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c index fb811fad33..793caccc93 100644 --- a/examples/l3fwd-vf/main.c +++ b/examples/l3fwd-vf/main.c @@ -1007,10 +1007,6 @@ MAIN(int argc, char **argv) if (ret < 0) rte_exit(EXIT_FAILURE, "init_lcore_rx_queues failed\n"); - /* init driver */ - if (rte_pmd_init_all() < 0) - rte_exit(EXIT_FAILURE, "Cannot init pmd\n"); - if (rte_eal_pci_probe() < 0) rte_exit(EXIT_FAILURE, "Cannot probe PCI\n"); diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 1ba4ca2d3c..8ee1af96fa 100755 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -1841,10 +1841,6 @@ MAIN(int argc, char **argv) rte_exit(EXIT_FAILURE, "init_lcore_rx_queues failed\n"); - /* init driver(s) */ - if (rte_pmd_init_all() < 0) - rte_exit(EXIT_FAILURE, "Cannot init pmd\n"); - if (rte_eal_pci_probe() < 0) rte_exit(EXIT_FAILURE, "Cannot probe PCI\n"); diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c index de6c87f8d0..8d17b0199d 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -663,10 +663,6 @@ MAIN(int argc, char **argv) if (lsi_pktmbuf_pool == NULL) rte_panic("Cannot init mbuf pool\n"); - /* init driver(s) */ - if (rte_pmd_init_all() < 0) - rte_panic("Cannot init pmd\n"); - if (rte_eal_pci_probe() < 0) rte_panic("Cannot probe PCI\n"); diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c index 6a2f21853c..e997238aa9 100644 --- a/examples/load_balancer/init.c +++ b/examples/load_balancer/init.c @@ -450,12 +450,6 @@ app_init_nics(void) int ret; uint32_t n_rx_queues, n_tx_queues; - /* Init driver */ - printf("Initializing the PMD driver ...\n"); - if (rte_pmd_init_all() < 0) { - rte_panic("Cannot init PMD\n"); - } - if (rte_eal_pci_probe() < 0) { rte_panic("Cannot probe PCI\n"); } diff --git a/examples/multi_process/client_server_mp/shared/init_drivers.h b/examples/multi_process/client_server_mp/shared/init_drivers.h index afa03bd569..5d9a90f9ac 100644 --- a/examples/multi_process/client_server_mp/shared/init_drivers.h +++ b/examples/multi_process/client_server_mp/shared/init_drivers.h @@ -40,7 +40,7 @@ static inline int init_drivers(void) { - if (rte_pmd_init_all() < 0 || rte_eal_pci_probe() < 0) + if (rte_eal_pci_probe() < 0) return -1; return 0; diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c index 3dd2b2a0d6..a34f420bbc 100644 --- a/examples/multi_process/l2fwd_fork/main.c +++ b/examples/multi_process/l2fwd_fork/main.c @@ -1050,10 +1050,6 @@ MAIN(int argc, char **argv) for (i = 0; i < RTE_MAX_LCORE; i++) lcore_resource[i].lcore_id = i; - /* init driver(s) */ - if (rte_pmd_init_all() < 0) - rte_exit(EXIT_FAILURE, "Cannot init pmd\n"); - if (rte_eal_pci_probe() < 0) rte_exit(EXIT_FAILURE, "Cannot probe PCI\n"); diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c index 12fa28d6a2..028f98d43d 100644 --- a/examples/multi_process/symmetric_mp/main.c +++ b/examples/multi_process/symmetric_mp/main.c @@ -463,8 +463,6 @@ main(int argc, char **argv) /* probe to determine the NIC devices available */ proc_type = rte_eal_process_type(); - if (rte_pmd_init_all() < 0) - rte_exit(EXIT_FAILURE, "Cannot init pmd\n"); if (rte_eal_pci_probe() < 0) rte_exit(EXIT_FAILURE, "Cannot probe PCI\n"); if (rte_eth_dev_count() == 0) diff --git a/examples/netmap_compat/bridge/bridge.c b/examples/netmap_compat/bridge/bridge.c index ecf5757651..e0cef5796c 100644 --- a/examples/netmap_compat/bridge/bridge.c +++ b/examples/netmap_compat/bridge/bridge.c @@ -294,10 +294,6 @@ int main(int argc, char *argv[]) if (ports.num == 0) rte_exit(EXIT_FAILURE, "no ports specified\n"); - err = rte_pmd_init_all(); - if (err < 0) - rte_exit(EXIT_FAILURE, "rte_pmd_init_all(): error %d\n", err); - err = rte_eal_pci_probe(); if (err < 0) rte_exit(EXIT_FAILURE, "rte_eal_pci_probe(): error %d\n", err); diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c index bc767034c2..e1698cc751 100755 --- a/examples/qos_meter/main.c +++ b/examples/qos_meter/main.c @@ -386,10 +386,6 @@ MAIN(int argc, char **argv) if (pool == NULL) rte_exit(EXIT_FAILURE, "Buffer pool creation error\n"); - /* PMD init */ - if (rte_pmd_init_all() < 0) - rte_exit(EXIT_FAILURE, "PMD init error\n"); - if (rte_eal_pci_probe() < 0) rte_exit(EXIT_FAILURE, "PCI probe error\n"); diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c index 7c5c62e148..e0218157b3 100755 --- a/examples/qos_sched/init.c +++ b/examples/qos_sched/init.c @@ -305,10 +305,6 @@ int app_init(void) char ring_name[MAX_NAME_LEN]; char pool_name[MAX_NAME_LEN]; - /* init driver(s) */ - if (rte_pmd_init_all() < 0) - rte_exit(EXIT_FAILURE, "Cannot init PMD\n"); - if (rte_eal_pci_probe() < 0) rte_exit(EXIT_FAILURE, "Cannot probe PCI\n"); diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c index f42eb8b888..44455b20e7 100644 --- a/examples/quota_watermark/qw/init.c +++ b/examples/quota_watermark/qw/init.c @@ -138,11 +138,6 @@ init_dpdk(void) { int ret; - /* Initialize the PMD */ - ret = rte_pmd_init_all(); - if (ret < 0) - rte_exit(EXIT_FAILURE, "Failed to initialize poll mode drivers (error %d)\n", ret); - /* Bind the drivers to usable devices */ ret = rte_eal_pci_probe(); if (ret < 0) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 816a71a920..b86d57dcca 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -1657,7 +1657,7 @@ MAIN(int argc, char *argv[]) if (ret < 0) rte_exit(EXIT_FAILURE, "Invalid argument\n"); - if (rte_pmd_init_all() != 0 || rte_eal_pci_probe() != 0) + if (rte_eal_pci_probe() != 0) rte_exit(EXIT_FAILURE, "Error with NIC driver initialization\n"); for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id ++) diff --git a/examples/vhost_xen/main.c b/examples/vhost_xen/main.c index eafc0aa290..2ec44ee8f9 100644 --- a/examples/vhost_xen/main.c +++ b/examples/vhost_xen/main.c @@ -1464,7 +1464,7 @@ MAIN(int argc, char *argv[]) if (ret < 0) rte_exit(EXIT_FAILURE, "Invalid argument\n"); - if (rte_pmd_init_all() != 0 || rte_eal_pci_probe() != 0) + if (rte_eal_pci_probe() != 0) rte_exit(EXIT_FAILURE, "Error with NIC driver initialization\n"); for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id ++) diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c index fac24aa5b9..0f52bdd763 100644 --- a/examples/vmdq/main.c +++ b/examples/vmdq/main.c @@ -597,7 +597,7 @@ MAIN(int argc, char *argv[]) if (ret < 0) rte_exit(EXIT_FAILURE, "Invalid VMDQ argument\n"); - if (rte_pmd_init_all() != 0 || rte_eal_pci_probe() != 0) + if (rte_eal_pci_probe() != 0) rte_exit(EXIT_FAILURE, "Error with NIC driver initialization\n"); for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id ++) diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 24288f8f26..d5ea46b9ff 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1315,33 +1315,6 @@ struct eth_driver { */ extern void rte_eth_driver_register(struct eth_driver *eth_drv); -/** - * The initialization function of *all* supported and enabled drivers. - * Right now, the following PMDs are supported: - * - igb - * - igbvf - * - em - * - ixgbe - * - ixgbevf - * - virtio - * - vmxnet3 - * This function is invoked once at EAL start time. - * @return - * 0 on success. - * Error code of the device initialization failure, - * -ENODEV if there are no drivers available - * (e.g. if all driver config options are = n). - */ -static inline -int rte_pmd_init_all(void) -{ - int ret = 0; - - if (ret == -ENODEV) - RTE_LOG(ERR, PMD, "No PMD(s) are configured\n"); - return (ret); -} - /** * Configure an Ethernet device. * This function must be invoked first before any other function in the