summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCiara Power <ciara.power@intel.com>2018-10-27 10:17:47 +0100
committerThomas Monjalon <thomas@monjalon.net>2018-10-27 15:18:23 +0200
commitc8e76f5ac34dee8f14a57265ff9cca4fe0e1de66 (patch)
tree02bd838ba248cbfcf5c31540996e057e1cc08cca /lib
parent0fe3a37924d4fb60c712098c33bdae3c2b9f5c6c (diff)
downloaddpdk-c8e76f5ac34dee8f14a57265ff9cca4fe0e1de66.zip
dpdk-c8e76f5ac34dee8f14a57265ff9cca4fe0e1de66.tar.gz
dpdk-c8e76f5ac34dee8f14a57265ff9cca4fe0e1de66.tar.xz
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 <ciara.power@intel.com> Signed-off-by: Brian Archbold <brian.archbold@intel.com> Signed-off-by: Kevin Laatz <kevin.laatz@intel.com> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/librte_telemetry/rte_telemetry.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/librte_telemetry/rte_telemetry.c b/lib/librte_telemetry/rte_telemetry.c
index dc085fe..016431f 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;
}