From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id E913537A6 for ; Wed, 7 Sep 2016 12:37:53 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP; 07 Sep 2016 03:37:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,296,1470726000"; d="scan'208";a="5504395" Received: from sie-lab-212-170.ir.intel.com (HELO silpixa00378251.ir.intel.com) ([10.237.212.170]) by fmsmga006.fm.intel.com with ESMTP; 07 Sep 2016 03:37:51 -0700 From: Maryam Tahhan To: dev@dpdk.org Cc: Maryam Tahhan Date: Wed, 7 Sep 2016 11:37:50 +0100 Message-Id: <1473244670-154926-1-git-send-email-maryam.tahhan@intel.com> X-Mailer: git-send-email 2.4.11 Subject: [dpdk-dev] [PATCH v2 1/1] dpdk_procinfo: check for primary process X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Sep 2016 10:37:54 -0000 Add a check to see if the primary process is running and exit gracefully if it is not. v2: * Updated to tone down message and remove unnecessary brackets. Suggested-by: Patrick Kutch Signed-off-by: Maryam Tahhan --- app/proc_info/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/proc_info/main.c b/app/proc_info/main.c index 6dc0bbb..9c1eb91 100644 --- a/app/proc_info/main.c +++ b/app/proc_info/main.c @@ -329,6 +329,9 @@ main(int argc, char **argv) argc -= ret; argv += (ret - 3); + if (!rte_eal_primary_proc_alive(NULL)) + rte_exit(EXIT_FAILURE, "No primary DPDK process is running.\n"); + /* parse app arguments */ ret = proc_info_parse_args(argc, argv); if (ret < 0) -- 2.4.11