The 'u32' and 'u64' data can not assigned to 'int' type variable. The 'u32' data need to use the 'u32' telemetry API to add, and the 'u64' data need to use the 'u64' telemetry API to add.
Fixes: e6732d0d6e26 ("mem: add telemetry infos") Cc: sta...@dpdk.org Signed-off-by: Huisong Li <lihuis...@huawei.com> Acked-by: Morten Brørup <m...@smartsharesystems.com> Acked-by: Chengwen Feng <fengcheng...@huawei.com> --- lib/eal/common/eal_common_memory.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c index 688dc615d7..b7981507da 100644 --- a/lib/eal/common/eal_common_memory.c +++ b/lib/eal/common/eal_common_memory.c @@ -1139,7 +1139,7 @@ handle_eal_heap_info_request(const char *cmd __rte_unused, const char *params, malloc_heap_get_stats(heap, &sock_stats); rte_tel_data_start_dict(d); - rte_tel_data_add_dict_int(d, "Head id", heap_id); + rte_tel_data_add_dict_u32(d, "Head id", heap_id); rte_tel_data_add_dict_string(d, "Name", heap->name); rte_tel_data_add_dict_u64(d, "Heap_size", sock_stats.heap_totalsz_bytes); @@ -1148,8 +1148,8 @@ handle_eal_heap_info_request(const char *cmd __rte_unused, const char *params, sock_stats.heap_allocsz_bytes); rte_tel_data_add_dict_u64(d, "Greatest_free_size", sock_stats.greatest_free_size); - rte_tel_data_add_dict_u64(d, "Alloc_count", sock_stats.alloc_count); - rte_tel_data_add_dict_u64(d, "Free_count", sock_stats.free_count); + rte_tel_data_add_dict_u32(d, "Alloc_count", sock_stats.alloc_count); + rte_tel_data_add_dict_u32(d, "Free_count", sock_stats.free_count); return 0; } @@ -1201,13 +1201,13 @@ handle_eal_memzone_info_request(const char *cmd __rte_unused, mz = rte_fbarray_get(&mcfg->memzones, mz_idx); rte_tel_data_start_dict(d); - rte_tel_data_add_dict_int(d, "Zone", mz_idx); + rte_tel_data_add_dict_u32(d, "Zone", mz_idx); rte_tel_data_add_dict_string(d, "Name", mz->name); - rte_tel_data_add_dict_int(d, "Length", mz->len); + rte_tel_data_add_dict_u64(d, "Length", mz->len); snprintf(addr, ADDR_STR, "%p", mz->addr); rte_tel_data_add_dict_string(d, "Address", addr); rte_tel_data_add_dict_int(d, "Socket", mz->socket_id); - rte_tel_data_add_dict_int(d, "Flags", mz->flags); + rte_tel_data_add_dict_u32(d, "Flags", mz->flags); /* go through each page occupied by this memzone */ msl = rte_mem_virt2memseg_list(mz->addr); @@ -1222,7 +1222,7 @@ handle_eal_memzone_info_request(const char *cmd __rte_unused, ms_idx = RTE_PTR_DIFF(mz->addr, msl->base_va) / page_sz; ms = rte_fbarray_get(&msl->memseg_arr, ms_idx); - rte_tel_data_add_dict_int(d, "Hugepage_size", page_sz); + rte_tel_data_add_dict_u64(d, "Hugepage_size", page_sz); snprintf(addr, ADDR_STR, "%p", ms->addr); rte_tel_data_add_dict_string(d, "Hugepage_base", addr); -- 2.33.0