From: Ciara Power Date: Sat, 27 Oct 2018 09:17:47 +0000 (+0100) Subject: telemetry: add ability to disable selftest X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c8e76f5ac34dee8f14a57265ff9cca4fe0e1de66;p=dpdk.git telemetry: add ability to disable selftest 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 Acked-by: Harry van Haaren --- diff --git a/lib/librte_telemetry/rte_telemetry.c b/lib/librte_telemetry/rte_telemetry.c index dc085fee0a..016431f123 100644 --- a/lib/librte_telemetry/rte_telemetry.c +++ b/lib/librte_telemetry/rte_telemetry.c @@ -660,6 +660,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); @@ -672,18 +673,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; }