From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id A20FC1B57C for ; Wed, 10 Oct 2018 12:52:29 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Oct 2018 03:52:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,364,1534834800"; d="scan'208";a="93916653" Received: from silpixa00397517.ir.intel.com (HELO silpixa00397517.ger.corp.intel.com) ([10.237.222.54]) by fmsmga002.fm.intel.com with ESMTP; 10 Oct 2018 03:51:45 -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, mattias.ronnblom@ericsson.com, bruce.richardson@intel.com, Ciara Power , Brian Archbold , Kevin Laatz Date: Wed, 10 Oct 2018 11:51:31 +0100 Message-Id: <20181010105134.48079-10-kevin.laatz@intel.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20181010105134.48079-1-kevin.laatz@intel.com> References: <20181003173612.67101-1-kevin.laatz@intel.com> <20181010105134.48079-1-kevin.laatz@intel.com> Subject: [dpdk-dev] [PATCH v3 09/12] 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, 10 Oct 2018 10:52:30 -0000 From: Ciara Power This patch adds functionality to enable/disable the selftest. This functionality will be extended in future to make the enabling/disabling more dynamic and remove this 'hardcoded' approach. We are temporarily using this approach due to the design changes (vdev vs eal) made to the library. 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 d7f0579..8f5fb44 100644 --- a/lib/librte_telemetry/rte_telemetry.c +++ b/lib/librte_telemetry/rte_telemetry.c @@ -656,6 +656,7 @@ rte_telemetry_initial_accept(struct telemetry_impl *telemetry) { uint16_t pid; int ret; + int selftest = 0; RTE_ETH_FOREACH_DEV(pid) { telemetry->reg_index = rte_telemetry_reg_ethdev_to_metrics(pid); @@ -668,18 +669,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