From patchwork Mon Feb 26 06:22:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Varghese, Vipin" X-Patchwork-Id: 35412 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C15654CAB; Mon, 26 Feb 2018 12:53:11 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 9FE744CA9 for ; Mon, 26 Feb 2018 12:53:10 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Feb 2018 03:53:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,396,1515484800"; d="scan'208";a="33666911" Received: from unknown (HELO localhost.localdomain) ([10.224.122.203]) by fmsmga001.fm.intel.com with ESMTP; 26 Feb 2018 03:53:08 -0800 From: Vipin Varghese To: dev@dpdk.org, reshma.pattan@intel.com Cc: john.mcnamara@intel.com, Vipin Varghese Date: Mon, 26 Feb 2018 11:52:38 +0530 Message-Id: <1519626158-10519-1-git-send-email-vipin.varghese@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519662622-10011-1-git-send-email-vipin.varghese@intel.com> References: <1519662622-10011-1-git-send-email-vipin.varghese@intel.com> Subject: [dpdk-dev] [PATCH v2] app/pdump: check for ports X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list 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 Acked-by: Reshma Pattan --- Changes in V2: - updated the exit message - Reshma --- app/pdump/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/pdump/main.c b/app/pdump/main.c index f6865bd..203faa3 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, "No Ethernet ports - bye\n"); + argc -= diag; argv += (diag - 3);