[dpdk-dev] [PATCH 15/15] pmd: Remove rte_pmd_init_all

Neil Horman nhorman at tuxdriver.com
Tue Apr 15 20:06:09 CEST 2014


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 <nhorman at tuxdriver.com>
---
 app/test-pmd/testpmd.c                             |  3 ---
 app/test/test_kni.c                                |  5 ----
 examples/exception_path/main.c                     |  5 ----
 examples/ip_reassembly/main.c                      |  4 ----
 examples/ipv4_frag/main.c                          |  4 ----
 examples/ipv4_multicast/main.c                     |  4 ----
 examples/kni/main.c                                |  5 ----
 examples/l2fwd-ivshmem/host/host.c                 |  4 ----
 examples/l2fwd/main.c                              |  4 ----
 examples/l3fwd-power/main.c                        |  4 ----
 examples/l3fwd-vf/main.c                           |  4 ----
 examples/l3fwd/main.c                              |  4 ----
 examples/link_status_interrupt/main.c              |  4 ----
 examples/load_balancer/init.c                      |  6 -----
 .../client_server_mp/shared/init_drivers.h         |  2 +-
 examples/multi_process/l2fwd_fork/main.c           |  4 ----
 examples/multi_process/symmetric_mp/main.c         |  2 --
 examples/netmap_compat/bridge/bridge.c             |  4 ----
 examples/qos_meter/main.c                          |  4 ----
 examples/qos_sched/init.c                          |  4 ----
 examples/quota_watermark/qw/init.c                 |  5 ----
 examples/vhost/main.c                              |  2 +-
 examples/vhost_xen/main.c                          |  2 +-
 examples/vmdq/main.c                               |  2 +-
 lib/librte_ether/rte_ethdev.h                      | 27 ----------------------
 25 files changed, 4 insertions(+), 114 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 04dca57..7f2dcde 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1755,9 +1755,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 e0fe44e..d37758b 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 0bc149d..d73b413 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 4880a5f..bafa8d9 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 93664c8..329f2ce 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 3bd37e4..da4e09d 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 274990b..fe823b3 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 6aaa082..e0627a4 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 2d94366..d04e27a 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 219f802..598b7a2 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 fb811fa..793cacc 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 1ba4ca2..8ee1af9 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 de6c87f..8d17b01 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 6a2f218..e997238 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 afa03bd..5d9a90f 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 3dd2b2a..a34f420 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 12fa28d..028f98d 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 ecf5757..e0cef57 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 bc76703..e1698cc 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 7c5c62e..e021815 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 f42eb8b..44455b2 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 816a71a..b86d57d 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 eafc0aa..2ec44ee 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 fac24aa..0f52bdd 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 24288f8..d5ea46b 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1316,33 +1316,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
  * Ethernet API. This function can also be re-invoked when a device is in the
-- 
1.8.3.1



More information about the dev mailing list