From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id BB85B1B171 for ; Wed, 3 Oct 2018 19:36:46 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Oct 2018 10:36:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,336,1534834800"; d="scan'208";a="96182500" Received: from silpixa00397517.ir.intel.com (HELO silpixa00397517.ger.corp.intel.com) ([10.237.222.54]) by orsmga001.jf.intel.com with ESMTP; 03 Oct 2018 10:36:36 -0700 From: Kevin Laatz To: dev@dpdk.org Cc: harry.van.haaren@intel.com, stephen@networkplumber.org, gaetan.rivet@6wind.com, shreyansh.jain@nxp.com, thomas@monjalon.net, Ciara Power , Brian Archbold , Kevin Laatz Date: Wed, 3 Oct 2018 18:36:10 +0100 Message-Id: <20181003173612.67101-9-kevin.laatz@intel.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20181003173612.67101-1-kevin.laatz@intel.com> References: <1535026093-101872-1-git-send-email-ciara.power@intel.com> <20181003173612.67101-1-kevin.laatz@intel.com> Subject: [dpdk-dev] [PATCH v2 08/10] telemetry: add ability to disable selftest 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: , X-List-Received-Date: Wed, 03 Oct 2018 17:36:47 -0000 From: Ciara Power This patch adds functionality to enable/disable the selftest. Signed-off-by: Ciara Power Signed-off-by: Brian Archbold Signed-off-by: Kevin Laatz --- lib/librte_telemetry/rte_telemetry.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/librte_telemetry/rte_telemetry.c b/lib/librte_telemetry/rte_telemetry.c index 43f7a93..5b87216 100644 --- a/lib/librte_telemetry/rte_telemetry.c +++ b/lib/librte_telemetry/rte_telemetry.c @@ -654,6 +654,7 @@ static int32_t rte_telemetry_initial_accept(struct telemetry_impl *telemetry) { int pid, ret; + int selftest = 0; RTE_ETH_FOREACH_DEV(pid) { telemetry->reg_index = rte_telemetry_reg_ethdev_to_metrics(pid); @@ -666,18 +667,20 @@ rte_telemetry_initial_accept(struct telemetry_impl *telemetry) } telemetry->metrics_register_done = 1; - ret = rte_telemetry_socket_messaging_testing(telemetry->reg_index, - telemetry->server_fd); - if (ret < 0) - return -1; + if (selftest) { + ret = rte_telemetry_socket_messaging_testing(telemetry->reg_index, + telemetry->server_fd); + if (ret < 0) + return -1; - ret = rte_telemetry_parser_test(telemetry); - if (ret < 0) { - TELEMETRY_LOG_ERR("Parser Tests Failed"); - return -1; - } + ret = rte_telemetry_parser_test(telemetry); + if (ret < 0) { + TELEMETRY_LOG_ERR("Parser Tests Failed"); + return -1; + } - TELEMETRY_LOG_INFO("Success - All Parser Tests Passed"); + TELEMETRY_LOG_INFO("Success - All Parser Tests Passed"); + } return 0; } -- 2.9.5