DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples: do not probe pci twice
@ 2014-09-26 12:31 Thomas Monjalon
  2014-09-26 13:42 ` David Marchand
  2014-09-26 14:11 ` Neil Horman
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Monjalon @ 2014-09-26 12:31 UTC (permalink / raw)
  To: dev

Since commit a155d430119 ("support link bonding device initialization"),
rte_eal_pci_probe() is called in rte_eal_init().
So it doesn't have to be called by application anymore.
It has been fixed for testpmd in commit 2950a769315,
and this patch remove it from other applications.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 app/test-pipeline/init.c                           |  5 ---
 app/test/test_kni.c                                |  5 ---
 examples/dpdk_qat/main.c                           |  3 --
 examples/exception_path/main.c                     |  5 ---
 examples/ip_fragmentation/main.c                   |  3 --
 examples/ip_pipeline/init.c                        |  5 ---
 examples/ip_reassembly/main.c                      |  3 --
 examples/ipv4_multicast/main.c                     |  3 --
 examples/kni/main.c                                |  5 ---
 examples/l2fwd-ivshmem/host/host.c                 |  3 --
 examples/l2fwd/main.c                              |  3 --
 examples/l3fwd-acl/main.c                          |  3 --
 examples/l3fwd-power/main.c                        |  3 --
 examples/l3fwd-vf/main.c                           |  3 --
 examples/l3fwd/main.c                              |  4 --
 examples/link_status_interrupt/main.c              |  3 --
 examples/load_balancer/init.c                      |  4 --
 .../client_server_mp/mp_client/client.c            |  3 --
 .../client_server_mp/mp_server/init.c              |  6 ---
 .../client_server_mp/shared/init_drivers.h         | 49 ----------------------
 examples/multi_process/l2fwd_fork/main.c           |  3 --
 examples/multi_process/symmetric_mp/main.c         |  6 +--
 examples/netmap_compat/bridge/bridge.c             |  4 --
 examples/qos_meter/main.c                          |  3 --
 examples/qos_sched/init.c                          |  3 --
 examples/quota_watermark/qw/init.c                 |  7 ----
 examples/vhost/main.c                              |  3 --
 examples/vhost_xen/main.c                          |  3 --
 examples/vmdq/main.c                               |  3 --
 29 files changed, 2 insertions(+), 154 deletions(-)
 delete mode 100644 examples/multi_process/client_server_mp/shared/init_drivers.h

diff --git a/app/test-pipeline/init.c b/app/test-pipeline/init.c
index a4337d0..17b6d23 100644
--- a/app/test-pipeline/init.c
+++ b/app/test-pipeline/init.c
@@ -228,11 +228,6 @@ app_init_ports(void)
 {
 	uint32_t i;
 
-	/* Init driver */
-	RTE_LOG(INFO, USER1, "Initializing the PMD driver ...\n");
-	if (rte_eal_pci_probe() < 0)
-		rte_panic("Cannot probe PCI\n");
-
 	/* Init NIC ports, then start the ports */
 	for (i = 0; i < app.n_ports; i++) {
 		uint8_t port;
diff --git a/app/test/test_kni.c b/app/test/test_kni.c
index 2860bf3..1081131 100644
--- a/app/test/test_kni.c
+++ b/app/test/test_kni.c
@@ -508,11 +508,6 @@ test_kni(void)
 		printf("fail to create mempool for kni\n");
 		return -1;
 	}
-	ret = rte_eal_pci_probe();
-	if (ret < 0) {
-		printf("fail to probe PCI devices\n");
-		return -1;
-	}
 
 	nb_ports = rte_eth_dev_count();
 	if (nb_ports == 0) {
diff --git a/examples/dpdk_qat/main.c b/examples/dpdk_qat/main.c
index 1599a0a..c130ea3 100644
--- a/examples/dpdk_qat/main.c
+++ b/examples/dpdk_qat/main.c
@@ -696,9 +696,6 @@ MAIN(int argc, char **argv)
 	if (ret < 0)
 		return -1;
 
-	if (rte_eal_pci_probe() < 0)
-		rte_panic("Cannot probe PCI\n");
-
 	if (check_lcore_params() < 0)
 		rte_panic("check_lcore_params failed\n");
 
diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index f286bf2..b485976 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -567,11 +567,6 @@ main(int argc, char** argv)
 		return -1;
 	}
 
-	/* Scan PCI bus for recognised devices */
-	ret = rte_eal_pci_probe();
-	if (ret < 0)
-		FATAL_ERROR("Could not probe PCI (%d)", ret);
-
 	/* Get number of ports found in scan */
 	nb_sys_ports = rte_eth_dev_count();
 	if (nb_sys_ports == 0)
diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 6d309b5..75028ac 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -871,9 +871,6 @@ MAIN(int argc, char **argv)
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Invalid arguments");
 
-	if (rte_eal_pci_probe() < 0)
-		rte_panic("Cannot probe PCI\n");
-
 	nb_ports = rte_eth_dev_count();
 	if (nb_ports > RTE_MAX_ETHPORTS)
 		nb_ports = RTE_MAX_ETHPORTS;
diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c
index e3ebd46..cb7568b 100644
--- a/examples/ip_pipeline/init.c
+++ b/examples/ip_pipeline/init.c
@@ -474,11 +474,6 @@ app_init_ports(void)
 {
 	uint32_t i;
 
-	/* Init driver */
-	RTE_LOG(INFO, USER1, "Initializing the PMD driver ...\n");
-	if (rte_eal_pci_probe() < 0)
-		rte_panic("Cannot probe PCI\n");
-
 	/* Init NIC ports, then start the ports */
 	for (i = 0; i < app.n_ports; i++) {
 		uint32_t port;
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index b6b4f59..9ba3f0a 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -1078,9 +1078,6 @@ MAIN(int argc, char **argv)
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Invalid IP reassembly parameters\n");
 
-	if (rte_eal_pci_probe() < 0)
-		rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
 	nb_ports = rte_eth_dev_count();
 	if (nb_ports > RTE_MAX_ETHPORTS)
 		nb_ports = RTE_MAX_ETHPORTS;
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 35bd842..5c2ab86 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -754,9 +754,6 @@ MAIN(int argc, char **argv)
 	if (clone_pool == NULL)
 		rte_exit(EXIT_FAILURE, "Cannot init clone mbuf pool\n");
 
-	if (rte_eal_pci_probe() < 0)
-		rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
 	nb_ports = rte_eth_dev_count();
 	if (nb_ports == 0)
 		rte_exit(EXIT_FAILURE, "No physical ports!\n");
diff --git a/examples/kni/main.c b/examples/kni/main.c
index 7df1b36..69d1ef2 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -889,11 +889,6 @@ main(int argc, char** argv)
 		return -1;
 	}
 
-	/* Scan PCI bus for recognised devices */
-	ret = rte_eal_pci_probe();
-	if (ret < 0)
-		rte_exit(EXIT_FAILURE, "Could not probe PCI (%d)\n", ret);
-
 	/* Get number of ports found in scan */
 	nb_sys_ports = rte_eth_dev_count();
 	if (nb_sys_ports == 0)
diff --git a/examples/l2fwd-ivshmem/host/host.c b/examples/l2fwd-ivshmem/host/host.c
index 02e65b9..1800b3a 100644
--- a/examples/l2fwd-ivshmem/host/host.c
+++ b/examples/l2fwd-ivshmem/host/host.c
@@ -716,9 +716,6 @@ int main(int argc, char **argv)
 	if (l2fwd_ivshmem_pktmbuf_pool == NULL)
 		rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
 
-	if (rte_eal_pci_probe() < 0)
-		rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
 	nb_ports = rte_eth_dev_count();
 	if (nb_ports == 0)
 		rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 4069d7c..e16c914 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -615,9 +615,6 @@ MAIN(int argc, char **argv)
 	if (l2fwd_pktmbuf_pool == NULL)
 		rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
 
-	if (rte_eal_pci_probe() < 0)
-		rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
 	nb_ports = rte_eth_dev_count();
 	if (nb_ports == 0)
 		rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index bafd26a..4dd6b34 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -1995,9 +1995,6 @@ MAIN(int argc, char **argv)
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "init_lcore_rx_queues failed\n");
 
-	if (rte_eal_pci_probe() < 0)
-		rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
 	nb_ports = rte_eth_dev_count();
 	if (nb_ports > RTE_MAX_ETHPORTS)
 		nb_ports = RTE_MAX_ETHPORTS;
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index a9d5c80..3bf63ff 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -1547,9 +1547,6 @@ MAIN(int argc, char **argv)
 		rte_exit(EXIT_FAILURE, "init_lcore_rx_queues failed\n");
 
 
-	if (rte_eal_pci_probe() < 0)
-		rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
 	nb_ports = rte_eth_dev_count();
 	if (nb_ports > RTE_MAX_ETHPORTS)
 		nb_ports = RTE_MAX_ETHPORTS;
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 7b1e08a..f567aa8 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -1007,9 +1007,6 @@ MAIN(int argc, char **argv)
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "init_lcore_rx_queues failed\n");
 
-	if (rte_eal_pci_probe() < 0)
-		rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
 	nb_ports = rte_eth_dev_count();
 	if (nb_ports > RTE_MAX_ETHPORTS)
 		nb_ports = RTE_MAX_ETHPORTS;
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index e3e3463..01220e3 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -2474,10 +2474,6 @@ MAIN(int argc, char **argv)
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "init_lcore_rx_queues failed\n");
 
-
-	if (rte_eal_pci_probe() < 0)
-		rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
 	nb_ports = rte_eth_dev_count();
 	if (nb_ports > RTE_MAX_ETHPORTS)
 		nb_ports = RTE_MAX_ETHPORTS;
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 1a87551..b8b7571 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -663,9 +663,6 @@ MAIN(int argc, char **argv)
 	if (lsi_pktmbuf_pool == NULL)
 		rte_panic("Cannot init mbuf pool\n");
 
-	if (rte_eal_pci_probe() < 0)
-		rte_panic("Cannot probe PCI\n");
-
 	nb_ports = rte_eth_dev_count();
 	if (nb_ports == 0)
 		rte_panic("No Ethernet port - bye\n");
diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index 2f00a70..a300706 100644
--- a/examples/load_balancer/init.c
+++ b/examples/load_balancer/init.c
@@ -450,10 +450,6 @@ app_init_nics(void)
 	int ret;
 	uint32_t n_rx_queues, n_tx_queues;
 
-	if (rte_eal_pci_probe() < 0) {
-		rte_panic("Cannot probe PCI\n");
-	}
-
 	/* Init NIC ports and queues, then start the ports */
 	for (port = 0; port < APP_MAX_NIC_PORTS; port ++) {
 		struct rte_mempool *pool;
diff --git a/examples/multi_process/client_server_mp/mp_client/client.c b/examples/multi_process/client_server_mp/mp_client/client.c
index ee2338c..af8f819 100644
--- a/examples/multi_process/client_server_mp/mp_client/client.c
+++ b/examples/multi_process/client_server_mp/mp_client/client.c
@@ -65,7 +65,6 @@
 #include <rte_string_fns.h>
 
 #include "common.h"
-#include "init_drivers.h"
 
 /* Number of packets to attempt to read from queue */
 #define PKT_READ_SIZE  ((uint16_t)32)
@@ -240,8 +239,6 @@ main(int argc, char *argv[])
 	if (parse_app_args(argc, argv) < 0)
 		rte_exit(EXIT_FAILURE, "Invalid command-line arguments\n");
 
-	if (init_drivers() < 0)
-		rte_exit(EXIT_FAILURE, "Cannot get NIC ports\n");
 	if (rte_eth_dev_count() == 0)
 		rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
 
diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/examples/multi_process/client_server_mp/mp_server/init.c
index a84d1ee..30518c0 100644
--- a/examples/multi_process/client_server_mp/mp_server/init.c
+++ b/examples/multi_process/client_server_mp/mp_server/init.c
@@ -66,7 +66,6 @@
 #include <rte_cycles.h>
 
 #include "common.h"
-#include "init_drivers.h"
 #include "args.h"
 #include "init.h"
 #include "main.h"
@@ -308,11 +307,6 @@ init(int argc, char *argv[])
 	argc -= retval;
 	argv += retval;
 
-	/* initialise the nic drivers */
-	retval = init_drivers();
-	if (retval != 0)
-		rte_exit(EXIT_FAILURE, "Cannot initialise drivers\n");
-
 	/* get total number of ports */
 	total_ports = rte_eth_dev_count();
 
diff --git a/examples/multi_process/client_server_mp/shared/init_drivers.h b/examples/multi_process/client_server_mp/shared/init_drivers.h
deleted file mode 100644
index 3c9881f..0000000
--- a/examples/multi_process/client_server_mp/shared/init_drivers.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- *   BSD LICENSE
- *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
- *   All rights reserved.
- *
- *   Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions
- *   are met:
- *
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in
- *       the documentation and/or other materials provided with the
- *       distribution.
- *     * Neither the name of Intel Corporation nor the names of its
- *       contributors may be used to endorse or promote products derived
- *       from this software without specific prior written permission.
- *
- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _INIT_DRIVERS_H_
-#define _INIT_DRIVERS_H_
-
-/**
- * Initialise all 1G and 10G NICs available
- */
-static inline int
-init_drivers(void)
-{
-	if (rte_eal_pci_probe() < 0)
-		return -1;
-
-	return 0;
-}
-
-#endif
diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c
index 03fba55..c887b63 100644
--- a/examples/multi_process/l2fwd_fork/main.c
+++ b/examples/multi_process/l2fwd_fork/main.c
@@ -1050,9 +1050,6 @@ MAIN(int argc, char **argv)
 	for (i = 0; i < RTE_MAX_LCORE; i++)
 		lcore_resource[i].lcore_id = i;
 
-	if (rte_eal_pci_probe() < 0)
-		rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
 	nb_ports = rte_eth_dev_count();
 	if (nb_ports == 0)
 		rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index b8f31b3..504a27a 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -461,16 +461,14 @@ main(int argc, char **argv)
 	argc -= ret;
 	argv += ret;
 
-	/* probe to determine the NIC devices available */
-	proc_type = rte_eal_process_type();
-	if (rte_eal_pci_probe() < 0)
-		rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
+	/* determine the NIC devices available */
 	if (rte_eth_dev_count() == 0)
 		rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
 
 	/* parse application arguments (those after the EAL ones) */
 	smp_parse_args(argc, argv);
 
+	proc_type = rte_eal_process_type();
 	mp = (proc_type == RTE_PROC_SECONDARY) ?
 			rte_mempool_lookup(_SMP_MBUF_POOL) :
 			rte_mempool_create(_SMP_MBUF_POOL, NB_MBUFS, MBUF_SIZE,
diff --git a/examples/netmap_compat/bridge/bridge.c b/examples/netmap_compat/bridge/bridge.c
index 898277e..d9ceb42 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_eal_pci_probe();
-	if (err < 0)
-		rte_exit(EXIT_FAILURE, "rte_eal_pci_probe(): error %d\n", err);
-
 	if (rte_eth_dev_count() < 1)
 		rte_exit(EXIT_FAILURE, "Not enough ethernet ports available\n");
 
diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index b4b8c4f..c02ac50 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -386,9 +386,6 @@ MAIN(int argc, char **argv)
 	if (pool == NULL)
 		rte_exit(EXIT_FAILURE, "Buffer pool creation error\n");
 
-	if (rte_eal_pci_probe() < 0)
-		rte_exit(EXIT_FAILURE, "PCI probe error\n");
-
 	/* NIC init */
 	ret = rte_eth_dev_configure(port_rx, 1, 1, &port_conf);
 	if (ret < 0)
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index cbfd63f..f38802e 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -304,9 +304,6 @@ int app_init(void)
 	char ring_name[MAX_NAME_LEN];
 	char pool_name[MAX_NAME_LEN];
 
-	if (rte_eal_pci_probe() < 0)
-		rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
 	if (rte_eth_dev_count() == 0)
 		rte_exit(EXIT_FAILURE, "No Ethernet port - bye\n");
 
diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c
index a7f8c85..9bc5db3 100644
--- a/examples/quota_watermark/qw/init.c
+++ b/examples/quota_watermark/qw/init.c
@@ -136,13 +136,6 @@ void configure_eth_port(uint8_t port_id)
 void
 init_dpdk(void)
 {
-    int ret;
-
-    /* Bind the drivers to usable devices */
-    ret = rte_eal_pci_probe();
-    if (ret < 0)
-        rte_exit(EXIT_FAILURE, "rte_eal_pci_probe(): error %d\n", ret);
-
     if (rte_eth_dev_count() < 2)
         rte_exit(EXIT_FAILURE, "Not enough ethernet port available\n");
 }
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 85ee8b8..c81b8f5 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -3549,9 +3549,6 @@ MAIN(int argc, char *argv[])
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Invalid argument\n");
 
-	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 ++)
 		if (rte_lcore_is_enabled(lcore_id))
 			lcore_ids[core_id ++] = lcore_id;
diff --git a/examples/vhost_xen/main.c b/examples/vhost_xen/main.c
index 56ffec8..498de06 100644
--- a/examples/vhost_xen/main.c
+++ b/examples/vhost_xen/main.c
@@ -1466,9 +1466,6 @@ MAIN(int argc, char *argv[])
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Invalid argument\n");
 
-	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 ++)
 		if (rte_lcore_is_enabled(lcore_id))
 			lcore_ids[core_id ++] = lcore_id;
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 35df234..a162d8b 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -597,9 +597,6 @@ MAIN(int argc, char *argv[])
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Invalid VMDQ argument\n");
 
-	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 ++)
 		if (rte_lcore_is_enabled(lcore_id))
 			lcore_ids[core_id ++] = lcore_id;
-- 
2.0.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] examples: do not probe pci twice
  2014-09-26 12:31 [dpdk-dev] [PATCH] examples: do not probe pci twice Thomas Monjalon
@ 2014-09-26 13:42 ` David Marchand
  2014-09-26 14:11 ` Neil Horman
  1 sibling, 0 replies; 4+ messages in thread
From: David Marchand @ 2014-09-26 13:42 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On Fri, Sep 26, 2014 at 2:31 PM, Thomas Monjalon <thomas.monjalon@6wind.com>
wrote:

> Since commit a155d430119 ("support link bonding device initialization"),
> rte_eal_pci_probe() is called in rte_eal_init().
> So it doesn't have to be called by application anymore.
> It has been fixed for testpmd in commit 2950a769315,
> and this patch remove it from other applications.
>
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> ---
>  app/test-pipeline/init.c                           |  5 ---
>  app/test/test_kni.c                                |  5 ---
>  examples/dpdk_qat/main.c                           |  3 --
>  examples/exception_path/main.c                     |  5 ---
>  examples/ip_fragmentation/main.c                   |  3 --
>  examples/ip_pipeline/init.c                        |  5 ---
>  examples/ip_reassembly/main.c                      |  3 --
>  examples/ipv4_multicast/main.c                     |  3 --
>  examples/kni/main.c                                |  5 ---
>  examples/l2fwd-ivshmem/host/host.c                 |  3 --
>  examples/l2fwd/main.c                              |  3 --
>  examples/l3fwd-acl/main.c                          |  3 --
>  examples/l3fwd-power/main.c                        |  3 --
>  examples/l3fwd-vf/main.c                           |  3 --
>  examples/l3fwd/main.c                              |  4 --
>  examples/link_status_interrupt/main.c              |  3 --
>  examples/load_balancer/init.c                      |  4 --
>  .../client_server_mp/mp_client/client.c            |  3 --
>  .../client_server_mp/mp_server/init.c              |  6 ---
>  .../client_server_mp/shared/init_drivers.h         | 49
> ----------------------
>  examples/multi_process/l2fwd_fork/main.c           |  3 --
>  examples/multi_process/symmetric_mp/main.c         |  6 +--
>  examples/netmap_compat/bridge/bridge.c             |  4 --
>  examples/qos_meter/main.c                          |  3 --
>  examples/qos_sched/init.c                          |  3 --
>  examples/quota_watermark/qw/init.c                 |  7 ----
>  examples/vhost/main.c                              |  3 --
>  examples/vhost_xen/main.c                          |  3 --
>  examples/vmdq/main.c                               |  3 --
>  29 files changed, 2 insertions(+), 154 deletions(-)
>  delete mode 100644
> examples/multi_process/client_server_mp/shared/init_drivers.h
>
> diff --git a/app/test-pipeline/init.c b/app/test-pipeline/init.c
> index a4337d0..17b6d23 100644
> --- a/app/test-pipeline/init.c
> +++ b/app/test-pipeline/init.c
> @@ -228,11 +228,6 @@ app_init_ports(void)
>  {
>         uint32_t i;
>
> -       /* Init driver */
> -       RTE_LOG(INFO, USER1, "Initializing the PMD driver ...\n");
> -       if (rte_eal_pci_probe() < 0)
> -               rte_panic("Cannot probe PCI\n");
> -
>         /* Init NIC ports, then start the ports */
>         for (i = 0; i < app.n_ports; i++) {
>                 uint8_t port;
> diff --git a/app/test/test_kni.c b/app/test/test_kni.c
> index 2860bf3..1081131 100644
> --- a/app/test/test_kni.c
> +++ b/app/test/test_kni.c
> @@ -508,11 +508,6 @@ test_kni(void)
>                 printf("fail to create mempool for kni\n");
>                 return -1;
>         }
> -       ret = rte_eal_pci_probe();
> -       if (ret < 0) {
> -               printf("fail to probe PCI devices\n");
> -               return -1;
> -       }
>
>         nb_ports = rte_eth_dev_count();
>         if (nb_ports == 0) {
> diff --git a/examples/dpdk_qat/main.c b/examples/dpdk_qat/main.c
> index 1599a0a..c130ea3 100644
> --- a/examples/dpdk_qat/main.c
> +++ b/examples/dpdk_qat/main.c
> @@ -696,9 +696,6 @@ MAIN(int argc, char **argv)
>         if (ret < 0)
>                 return -1;
>
> -       if (rte_eal_pci_probe() < 0)
> -               rte_panic("Cannot probe PCI\n");
> -
>         if (check_lcore_params() < 0)
>                 rte_panic("check_lcore_params failed\n");
>
> diff --git a/examples/exception_path/main.c
> b/examples/exception_path/main.c
> index f286bf2..b485976 100644
> --- a/examples/exception_path/main.c
> +++ b/examples/exception_path/main.c
> @@ -567,11 +567,6 @@ main(int argc, char** argv)
>                 return -1;
>         }
>
> -       /* Scan PCI bus for recognised devices */
> -       ret = rte_eal_pci_probe();
> -       if (ret < 0)
> -               FATAL_ERROR("Could not probe PCI (%d)", ret);
> -
>         /* Get number of ports found in scan */
>         nb_sys_ports = rte_eth_dev_count();
>         if (nb_sys_ports == 0)
> diff --git a/examples/ip_fragmentation/main.c
> b/examples/ip_fragmentation/main.c
> index 6d309b5..75028ac 100644
> --- a/examples/ip_fragmentation/main.c
> +++ b/examples/ip_fragmentation/main.c
> @@ -871,9 +871,6 @@ MAIN(int argc, char **argv)
>         if (ret < 0)
>                 rte_exit(EXIT_FAILURE, "Invalid arguments");
>
> -       if (rte_eal_pci_probe() < 0)
> -               rte_panic("Cannot probe PCI\n");
> -
>         nb_ports = rte_eth_dev_count();
>         if (nb_ports > RTE_MAX_ETHPORTS)
>                 nb_ports = RTE_MAX_ETHPORTS;
> diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c
> index e3ebd46..cb7568b 100644
> --- a/examples/ip_pipeline/init.c
> +++ b/examples/ip_pipeline/init.c
> @@ -474,11 +474,6 @@ app_init_ports(void)
>  {
>         uint32_t i;
>
> -       /* Init driver */
> -       RTE_LOG(INFO, USER1, "Initializing the PMD driver ...\n");
> -       if (rte_eal_pci_probe() < 0)
> -               rte_panic("Cannot probe PCI\n");
> -
>         /* Init NIC ports, then start the ports */
>         for (i = 0; i < app.n_ports; i++) {
>                 uint32_t port;
> diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
> index b6b4f59..9ba3f0a 100644
> --- a/examples/ip_reassembly/main.c
> +++ b/examples/ip_reassembly/main.c
> @@ -1078,9 +1078,6 @@ MAIN(int argc, char **argv)
>         if (ret < 0)
>                 rte_exit(EXIT_FAILURE, "Invalid IP reassembly
> parameters\n");
>
> -       if (rte_eal_pci_probe() < 0)
> -               rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
> -
>         nb_ports = rte_eth_dev_count();
>         if (nb_ports > RTE_MAX_ETHPORTS)
>                 nb_ports = RTE_MAX_ETHPORTS;
> diff --git a/examples/ipv4_multicast/main.c
> b/examples/ipv4_multicast/main.c
> index 35bd842..5c2ab86 100644
> --- a/examples/ipv4_multicast/main.c
> +++ b/examples/ipv4_multicast/main.c
> @@ -754,9 +754,6 @@ MAIN(int argc, char **argv)
>         if (clone_pool == NULL)
>                 rte_exit(EXIT_FAILURE, "Cannot init clone mbuf pool\n");
>
> -       if (rte_eal_pci_probe() < 0)
> -               rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
> -
>         nb_ports = rte_eth_dev_count();
>         if (nb_ports == 0)
>                 rte_exit(EXIT_FAILURE, "No physical ports!\n");
> diff --git a/examples/kni/main.c b/examples/kni/main.c
> index 7df1b36..69d1ef2 100644
> --- a/examples/kni/main.c
> +++ b/examples/kni/main.c
> @@ -889,11 +889,6 @@ main(int argc, char** argv)
>                 return -1;
>         }
>
> -       /* Scan PCI bus for recognised devices */
> -       ret = rte_eal_pci_probe();
> -       if (ret < 0)
> -               rte_exit(EXIT_FAILURE, "Could not probe PCI (%d)\n", ret);
> -
>         /* Get number of ports found in scan */
>         nb_sys_ports = rte_eth_dev_count();
>         if (nb_sys_ports == 0)
> diff --git a/examples/l2fwd-ivshmem/host/host.c
> b/examples/l2fwd-ivshmem/host/host.c
> index 02e65b9..1800b3a 100644
> --- a/examples/l2fwd-ivshmem/host/host.c
> +++ b/examples/l2fwd-ivshmem/host/host.c
> @@ -716,9 +716,6 @@ int main(int argc, char **argv)
>         if (l2fwd_ivshmem_pktmbuf_pool == NULL)
>                 rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
>
> -       if (rte_eal_pci_probe() < 0)
> -               rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
> -
>         nb_ports = rte_eth_dev_count();
>         if (nb_ports == 0)
>                 rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
> diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
> index 4069d7c..e16c914 100644
> --- a/examples/l2fwd/main.c
> +++ b/examples/l2fwd/main.c
> @@ -615,9 +615,6 @@ MAIN(int argc, char **argv)
>         if (l2fwd_pktmbuf_pool == NULL)
>                 rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
>
> -       if (rte_eal_pci_probe() < 0)
> -               rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
> -
>         nb_ports = rte_eth_dev_count();
>         if (nb_ports == 0)
>                 rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
> diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
> index bafd26a..4dd6b34 100644
> --- a/examples/l3fwd-acl/main.c
> +++ b/examples/l3fwd-acl/main.c
> @@ -1995,9 +1995,6 @@ MAIN(int argc, char **argv)
>         if (ret < 0)
>                 rte_exit(EXIT_FAILURE, "init_lcore_rx_queues failed\n");
>
> -       if (rte_eal_pci_probe() < 0)
> -               rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
> -
>         nb_ports = rte_eth_dev_count();
>         if (nb_ports > RTE_MAX_ETHPORTS)
>                 nb_ports = RTE_MAX_ETHPORTS;
> diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
> index a9d5c80..3bf63ff 100644
> --- a/examples/l3fwd-power/main.c
> +++ b/examples/l3fwd-power/main.c
> @@ -1547,9 +1547,6 @@ MAIN(int argc, char **argv)
>                 rte_exit(EXIT_FAILURE, "init_lcore_rx_queues failed\n");
>
>
> -       if (rte_eal_pci_probe() < 0)
> -               rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
> -
>         nb_ports = rte_eth_dev_count();
>         if (nb_ports > RTE_MAX_ETHPORTS)
>                 nb_ports = RTE_MAX_ETHPORTS;
> diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
> index 7b1e08a..f567aa8 100644
> --- a/examples/l3fwd-vf/main.c
> +++ b/examples/l3fwd-vf/main.c
> @@ -1007,9 +1007,6 @@ MAIN(int argc, char **argv)
>         if (ret < 0)
>                 rte_exit(EXIT_FAILURE, "init_lcore_rx_queues failed\n");
>
> -       if (rte_eal_pci_probe() < 0)
> -               rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
> -
>         nb_ports = rte_eth_dev_count();
>         if (nb_ports > RTE_MAX_ETHPORTS)
>                 nb_ports = RTE_MAX_ETHPORTS;
> diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
> index e3e3463..01220e3 100644
> --- a/examples/l3fwd/main.c
> +++ b/examples/l3fwd/main.c
> @@ -2474,10 +2474,6 @@ MAIN(int argc, char **argv)
>         if (ret < 0)
>                 rte_exit(EXIT_FAILURE, "init_lcore_rx_queues failed\n");
>
> -
> -       if (rte_eal_pci_probe() < 0)
> -               rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
> -
>         nb_ports = rte_eth_dev_count();
>         if (nb_ports > RTE_MAX_ETHPORTS)
>                 nb_ports = RTE_MAX_ETHPORTS;
> diff --git a/examples/link_status_interrupt/main.c
> b/examples/link_status_interrupt/main.c
> index 1a87551..b8b7571 100644
> --- a/examples/link_status_interrupt/main.c
> +++ b/examples/link_status_interrupt/main.c
> @@ -663,9 +663,6 @@ MAIN(int argc, char **argv)
>         if (lsi_pktmbuf_pool == NULL)
>                 rte_panic("Cannot init mbuf pool\n");
>
> -       if (rte_eal_pci_probe() < 0)
> -               rte_panic("Cannot probe PCI\n");
> -
>         nb_ports = rte_eth_dev_count();
>         if (nb_ports == 0)
>                 rte_panic("No Ethernet port - bye\n");
> diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
> index 2f00a70..a300706 100644
> --- a/examples/load_balancer/init.c
> +++ b/examples/load_balancer/init.c
> @@ -450,10 +450,6 @@ app_init_nics(void)
>         int ret;
>         uint32_t n_rx_queues, n_tx_queues;
>
> -       if (rte_eal_pci_probe() < 0) {
> -               rte_panic("Cannot probe PCI\n");
> -       }
> -
>         /* Init NIC ports and queues, then start the ports */
>         for (port = 0; port < APP_MAX_NIC_PORTS; port ++) {
>                 struct rte_mempool *pool;
> diff --git a/examples/multi_process/client_server_mp/mp_client/client.c
> b/examples/multi_process/client_server_mp/mp_client/client.c
> index ee2338c..af8f819 100644
> --- a/examples/multi_process/client_server_mp/mp_client/client.c
> +++ b/examples/multi_process/client_server_mp/mp_client/client.c
> @@ -65,7 +65,6 @@
>  #include <rte_string_fns.h>
>
>  #include "common.h"
> -#include "init_drivers.h"
>
>  /* Number of packets to attempt to read from queue */
>  #define PKT_READ_SIZE  ((uint16_t)32)
> @@ -240,8 +239,6 @@ main(int argc, char *argv[])
>         if (parse_app_args(argc, argv) < 0)
>                 rte_exit(EXIT_FAILURE, "Invalid command-line arguments\n");
>
> -       if (init_drivers() < 0)
> -               rte_exit(EXIT_FAILURE, "Cannot get NIC ports\n");
>         if (rte_eth_dev_count() == 0)
>                 rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
>
> diff --git a/examples/multi_process/client_server_mp/mp_server/init.c
> b/examples/multi_process/client_server_mp/mp_server/init.c
> index a84d1ee..30518c0 100644
> --- a/examples/multi_process/client_server_mp/mp_server/init.c
> +++ b/examples/multi_process/client_server_mp/mp_server/init.c
> @@ -66,7 +66,6 @@
>  #include <rte_cycles.h>
>
>  #include "common.h"
> -#include "init_drivers.h"
>  #include "args.h"
>  #include "init.h"
>  #include "main.h"
> @@ -308,11 +307,6 @@ init(int argc, char *argv[])
>         argc -= retval;
>         argv += retval;
>
> -       /* initialise the nic drivers */
> -       retval = init_drivers();
> -       if (retval != 0)
> -               rte_exit(EXIT_FAILURE, "Cannot initialise drivers\n");
> -
>         /* get total number of ports */
>         total_ports = rte_eth_dev_count();
>
> diff --git a/examples/multi_process/client_server_mp/shared/init_drivers.h
> b/examples/multi_process/client_server_mp/shared/init_drivers.h
> deleted file mode 100644
> index 3c9881f..0000000
> --- a/examples/multi_process/client_server_mp/shared/init_drivers.h
> +++ /dev/null
> @@ -1,49 +0,0 @@
> -/*-
> - *   BSD LICENSE
> - *
> - *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> - *   All rights reserved.
> - *
> - *   Redistribution and use in source and binary forms, with or without
> - *   modification, are permitted provided that the following conditions
> - *   are met:
> - *
> - *     * Redistributions of source code must retain the above copyright
> - *       notice, this list of conditions and the following disclaimer.
> - *     * Redistributions in binary form must reproduce the above copyright
> - *       notice, this list of conditions and the following disclaimer in
> - *       the documentation and/or other materials provided with the
> - *       distribution.
> - *     * Neither the name of Intel Corporation nor the names of its
> - *       contributors may be used to endorse or promote products derived
> - *       from this software without specific prior written permission.
> - *
> - *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> - *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> - *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> - *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> - *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> - *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> - *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> - *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> - *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> - *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> - *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> - */
> -
> -#ifndef _INIT_DRIVERS_H_
> -#define _INIT_DRIVERS_H_
> -
> -/**
> - * Initialise all 1G and 10G NICs available
> - */
> -static inline int
> -init_drivers(void)
> -{
> -       if (rte_eal_pci_probe() < 0)
> -               return -1;
> -
> -       return 0;
> -}
> -
> -#endif
> diff --git a/examples/multi_process/l2fwd_fork/main.c
> b/examples/multi_process/l2fwd_fork/main.c
> index 03fba55..c887b63 100644
> --- a/examples/multi_process/l2fwd_fork/main.c
> +++ b/examples/multi_process/l2fwd_fork/main.c
> @@ -1050,9 +1050,6 @@ MAIN(int argc, char **argv)
>         for (i = 0; i < RTE_MAX_LCORE; i++)
>                 lcore_resource[i].lcore_id = i;
>
> -       if (rte_eal_pci_probe() < 0)
> -               rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
> -
>         nb_ports = rte_eth_dev_count();
>         if (nb_ports == 0)
>                 rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
> diff --git a/examples/multi_process/symmetric_mp/main.c
> b/examples/multi_process/symmetric_mp/main.c
> index b8f31b3..504a27a 100644
> --- a/examples/multi_process/symmetric_mp/main.c
> +++ b/examples/multi_process/symmetric_mp/main.c
> @@ -461,16 +461,14 @@ main(int argc, char **argv)
>         argc -= ret;
>         argv += ret;
>
> -       /* probe to determine the NIC devices available */
> -       proc_type = rte_eal_process_type();
> -       if (rte_eal_pci_probe() < 0)
> -               rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
> +       /* determine the NIC devices available */
>         if (rte_eth_dev_count() == 0)
>                 rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
>
>         /* parse application arguments (those after the EAL ones) */
>         smp_parse_args(argc, argv);
>
> +       proc_type = rte_eal_process_type();
>         mp = (proc_type == RTE_PROC_SECONDARY) ?
>                         rte_mempool_lookup(_SMP_MBUF_POOL) :
>                         rte_mempool_create(_SMP_MBUF_POOL, NB_MBUFS,
> MBUF_SIZE,
> diff --git a/examples/netmap_compat/bridge/bridge.c
> b/examples/netmap_compat/bridge/bridge.c
> index 898277e..d9ceb42 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_eal_pci_probe();
> -       if (err < 0)
> -               rte_exit(EXIT_FAILURE, "rte_eal_pci_probe(): error %d\n",
> err);
> -
>         if (rte_eth_dev_count() < 1)
>                 rte_exit(EXIT_FAILURE, "Not enough ethernet ports
> available\n");
>
> diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
> index b4b8c4f..c02ac50 100644
> --- a/examples/qos_meter/main.c
> +++ b/examples/qos_meter/main.c
> @@ -386,9 +386,6 @@ MAIN(int argc, char **argv)
>         if (pool == NULL)
>                 rte_exit(EXIT_FAILURE, "Buffer pool creation error\n");
>
> -       if (rte_eal_pci_probe() < 0)
> -               rte_exit(EXIT_FAILURE, "PCI probe error\n");
> -
>         /* NIC init */
>         ret = rte_eth_dev_configure(port_rx, 1, 1, &port_conf);
>         if (ret < 0)
> diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
> index cbfd63f..f38802e 100644
> --- a/examples/qos_sched/init.c
> +++ b/examples/qos_sched/init.c
> @@ -304,9 +304,6 @@ int app_init(void)
>         char ring_name[MAX_NAME_LEN];
>         char pool_name[MAX_NAME_LEN];
>
> -       if (rte_eal_pci_probe() < 0)
> -               rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
> -
>         if (rte_eth_dev_count() == 0)
>                 rte_exit(EXIT_FAILURE, "No Ethernet port - bye\n");
>
> diff --git a/examples/quota_watermark/qw/init.c
> b/examples/quota_watermark/qw/init.c
> index a7f8c85..9bc5db3 100644
> --- a/examples/quota_watermark/qw/init.c
> +++ b/examples/quota_watermark/qw/init.c
> @@ -136,13 +136,6 @@ void configure_eth_port(uint8_t port_id)
>  void
>  init_dpdk(void)
>  {
> -    int ret;
> -
> -    /* Bind the drivers to usable devices */
> -    ret = rte_eal_pci_probe();
> -    if (ret < 0)
> -        rte_exit(EXIT_FAILURE, "rte_eal_pci_probe(): error %d\n", ret);
> -
>      if (rte_eth_dev_count() < 2)
>          rte_exit(EXIT_FAILURE, "Not enough ethernet port available\n");
>  }
> diff --git a/examples/vhost/main.c b/examples/vhost/main.c
> index 85ee8b8..c81b8f5 100644
> --- a/examples/vhost/main.c
> +++ b/examples/vhost/main.c
> @@ -3549,9 +3549,6 @@ MAIN(int argc, char *argv[])
>         if (ret < 0)
>                 rte_exit(EXIT_FAILURE, "Invalid argument\n");
>
> -       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 ++)
>                 if (rte_lcore_is_enabled(lcore_id))
>                         lcore_ids[core_id ++] = lcore_id;
> diff --git a/examples/vhost_xen/main.c b/examples/vhost_xen/main.c
> index 56ffec8..498de06 100644
> --- a/examples/vhost_xen/main.c
> +++ b/examples/vhost_xen/main.c
> @@ -1466,9 +1466,6 @@ MAIN(int argc, char *argv[])
>         if (ret < 0)
>                 rte_exit(EXIT_FAILURE, "Invalid argument\n");
>
> -       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 ++)
>                 if (rte_lcore_is_enabled(lcore_id))
>                         lcore_ids[core_id ++] = lcore_id;
> diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
> index 35df234..a162d8b 100644
> --- a/examples/vmdq/main.c
> +++ b/examples/vmdq/main.c
> @@ -597,9 +597,6 @@ MAIN(int argc, char *argv[])
>         if (ret < 0)
>                 rte_exit(EXIT_FAILURE, "Invalid VMDQ argument\n");
>
> -       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 ++)
>                 if (rte_lcore_is_enabled(lcore_id))
>                         lcore_ids[core_id ++] = lcore_id;
> --
> 2.0.4
>
>

It looks good to me.
Acked-by: David Marchand <david.marchand@6wind.com>

-- 
David Marchand

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] examples: do not probe pci twice
  2014-09-26 12:31 [dpdk-dev] [PATCH] examples: do not probe pci twice Thomas Monjalon
  2014-09-26 13:42 ` David Marchand
@ 2014-09-26 14:11 ` Neil Horman
  2014-09-29 12:15   ` Thomas Monjalon
  1 sibling, 1 reply; 4+ messages in thread
From: Neil Horman @ 2014-09-26 14:11 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On Fri, Sep 26, 2014 at 02:31:24PM +0200, Thomas Monjalon wrote:
> Since commit a155d430119 ("support link bonding device initialization"),
> rte_eal_pci_probe() is called in rte_eal_init().
> So it doesn't have to be called by application anymore.
> It has been fixed for testpmd in commit 2950a769315,
> and this patch remove it from other applications.
> 
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>

Acked-by: Neil Horman <nhorman@tuxdriver.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] examples: do not probe pci twice
  2014-09-26 14:11 ` Neil Horman
@ 2014-09-29 12:15   ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2014-09-29 12:15 UTC (permalink / raw)
  To: Declan Doherty; +Cc: dev

> > Since commit a155d430119 ("support link bonding device initialization"),
> > rte_eal_pci_probe() is called in rte_eal_init().
> > So it doesn't have to be called by application anymore.
> > It has been fixed for testpmd in commit 2950a769315,
> > and this patch remove it from other applications.
> > 
> > Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> 
> Acked-by: Neil Horman <nhorman@tuxdriver.com>

Applied in the serie about bonding cleanup.

-- 
Thomas

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-09-29 12:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-26 12:31 [dpdk-dev] [PATCH] examples: do not probe pci twice Thomas Monjalon
2014-09-26 13:42 ` David Marchand
2014-09-26 14:11 ` Neil Horman
2014-09-29 12:15   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).