rte_log_register_type_and_pick_level() returns an int.
Casting to a uin32_t will make us miss the -1 passed in case of failure.
Fallback to EAL log type like RTE_LOG_REGISTER.
Fixes:
37b881a96194 ("telemetry: use log function from pointer")
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
return -1;
}
if (!internal_conf->no_telemetry) {
- uint32_t tlog = rte_log_register_type_and_pick_level(
+ int tlog = rte_log_register_type_and_pick_level(
"lib.telemetry", RTE_LOG_WARNING);
+ if (tlog < 0)
+ tlog = RTE_LOGTYPE_EAL;
if (rte_telemetry_init(rte_eal_get_runtime_dir(),
rte_version(),
&internal_conf->ctrl_cpuset, rte_log, tlog) != 0)
return -1;
}
if (!internal_conf->no_telemetry) {
- uint32_t tlog = rte_log_register_type_and_pick_level(
+ int tlog = rte_log_register_type_and_pick_level(
"lib.telemetry", RTE_LOG_WARNING);
+ if (tlog < 0)
+ tlog = RTE_LOGTYPE_EAL;
if (rte_telemetry_init(rte_eal_get_runtime_dir(),
rte_version(),
&internal_conf->ctrl_cpuset, rte_log, tlog) != 0)