From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vipin Varghese Subject: [PATCH] app/pdump: check for ports Date: Mon, 26 Feb 2018 22:00:22 +0530 Message-ID: <1519662622-10011-1-git-send-email-vipin.varghese@intel.com> Cc: john.mcnamara@intel.com, Vipin Varghese To: dev@dpdk.org, reshma.pattan@intel.com Return-path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 7D3651BE0 for ; Mon, 26 Feb 2018 11:48:47 +0100 (CET) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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