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>
{
uint16_t pid;
int ret;
+ int selftest = 0;
RTE_ETH_FOREACH_DEV(pid) {
telemetry->reg_index = rte_telemetry_reg_ethdev_to_metrics(pid);
}
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;
}