[dpdk-dev] [PATCH] app/pdump: check for ports
Vipin Varghese
vipin.varghese at intel.com
Mon Feb 26 17:30:22 CET 2018
In case of application build with shared library mode unless
option '-d' is passed, poll mode driver for devices is not
initialized. Notifying the user just after rte_eal_init is
pro active way of intimating the user.
Signed-off-by: Vipin Varghese <vipin.varghese at intel.com>
---
app/pdump/main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/app/pdump/main.c b/app/pdump/main.c
index f6865bd..4242a19 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -863,6 +863,9 @@ struct parse_val {
if (diag < 0)
rte_panic("Cannot init EAL\n");
+ if (rte_eth_dev_count() == 0)
+ rte_exit(EXIT_FAILURE, "Failed to fetch ports for PDUMP!\n");
+
argc -= diag;
argv += (diag - 3);
--
1.9.1
More information about the dev
mailing list