From 4dbfce05836b77d53f9045933cf1003b41f9562d Mon Sep 17 00:00:00 2001 From: Vipin Varghese Date: Mon, 26 Feb 2018 11:52:38 +0530 Subject: [PATCH] app/pdump: check for ports 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 Acked-by: Reshma Pattan --- app/pdump/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/pdump/main.c b/app/pdump/main.c index 1f43e3fd7e..aa0f3a34de 100644 --- a/app/pdump/main.c +++ b/app/pdump/main.c @@ -847,6 +847,9 @@ main(int argc, char **argv) if (diag < 0) rte_panic("Cannot init EAL\n"); + if (rte_eth_dev_count_avail() == 0) + rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n"); + argc -= diag; argv += (diag - 3); -- 2.20.1