From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id EE97568F2 for ; Tue, 6 Sep 2016 19:12:09 +0200 (CEST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP; 06 Sep 2016 10:12:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,292,1470726000"; d="scan'208";a="5125624" Received: from sie-lab-212-170.ir.intel.com (HELO silpixa00378251.ir.intel.com) ([10.237.212.170]) by fmsmga005.fm.intel.com with ESMTP; 06 Sep 2016 10:12:07 -0700 From: Maryam Tahhan To: dev@dpdk.org Cc: patrick.g.kutch@intel.com, Maryam Tahhan Date: Tue, 6 Sep 2016 18:12:05 +0100 Message-Id: <1473181925-127253-1-git-send-email-maryam.tahhan@intel.com> X-Mailer: git-send-email 2.4.11 Subject: [dpdk-dev] [PATCH] 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: Tue, 06 Sep 2016 17:12:10 -0000 Add a check to see if the primary process is running and exit gracefully if it is not. Suggested-by: Patrick Kutch Signed-off-by: Maryam Tahhan --- app/proc_info/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/proc_info/main.c b/app/proc_info/main.c index 6dc0bbb..ddc8cf8 100644 --- a/app/proc_info/main.c +++ b/app/proc_info/main.c @@ -329,6 +329,11 @@ 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