From patchwork Thu Dec 15 10:31:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 120939 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 42963A0543; Thu, 15 Dec 2022 11:31:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B73940695; Thu, 15 Dec 2022 11:31:47 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id B1F3540223 for ; Thu, 15 Dec 2022 11:31:45 +0100 (CET) Received: from kwepemm600004.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NXpRD6PNHzJqYB; Thu, 15 Dec 2022 18:30:48 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 15 Dec 2022 18:31:43 +0800 From: Huisong Li To: CC: , , , , , , Subject: [PATCH V6 1/8] telemetry: move to header to controllable range Date: Thu, 15 Dec 2022 18:31:39 +0800 Message-ID: <20221215103146.816-2-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20221215103146.816-1-lihuisong@huawei.com> References: <20221208080540.62913-1-lihuisong@huawei.com> <20221215103146.816-1-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600004.china.huawei.com (7.193.23.242) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The "stdint.h" header is outside '_RTE_TELEMETRY_H_' macro, which cause this header is unconditional. So this patch moves this header to inside '_RTE_TELEMETRY_H_'. Fixes: 99a2dd955fba ("lib: remove librte_ prefix from directory names") Cc: stable@dpdk.org Signed-off-by: Huisong Li Acked-by: Morten Brørup Acked-by: Chengwen Feng Acked-by: Bruce Richardson --- lib/telemetry/rte_telemetry.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/telemetry/rte_telemetry.h b/lib/telemetry/rte_telemetry.h index d9918c4e96..40e9a3bf9d 100644 --- a/lib/telemetry/rte_telemetry.h +++ b/lib/telemetry/rte_telemetry.h @@ -2,9 +2,6 @@ * Copyright(c) 2018 Intel Corporation */ -#include - - #ifndef _RTE_TELEMETRY_H_ #define _RTE_TELEMETRY_H_ @@ -12,6 +9,8 @@ extern "C" { #endif +#include + /** Maximum length for string used in object. */ #define RTE_TEL_MAX_STRING_LEN 128 /** Maximum length of string. */ From patchwork Thu Dec 15 10:31:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 120941 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0CAF3A0543; Thu, 15 Dec 2022 11:31:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F00F742D14; Thu, 15 Dec 2022 11:31:49 +0100 (CET) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id 084BB40685 for ; Thu, 15 Dec 2022 11:31:46 +0100 (CET) Received: from kwepemm600004.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NXpR907BYz16LdB; Thu, 15 Dec 2022 18:30:44 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 15 Dec 2022 18:31:44 +0800 From: Huisong Li To: CC: , , , , , , Subject: [PATCH V6 2/8] ethdev: fix possible data truncation and conversion error Date: Thu, 15 Dec 2022 18:31:40 +0800 Message-ID: <20221215103146.816-3-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20221215103146.816-1-lihuisong@huawei.com> References: <20221208080540.62913-1-lihuisong@huawei.com> <20221215103146.816-1-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600004.china.huawei.com (7.193.23.242) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The 'u32' and 'u64' data can not assigned to 'int' type variable. They need to use the 'u64' APIs to add. Fixes: 58b43c1ddfd1 ("ethdev: add telemetry endpoint for device info") Cc: stable@dpdk.org Signed-off-by: Huisong Li Acked-by: Morten Brørup Acked-by: Chengwen Feng --- lib/ethdev/rte_ethdev.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 5d5e18db1e..a40d396677 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -6037,9 +6037,9 @@ eth_dev_handle_port_info(const char *cmd __rte_unused, eth_dev->data->nb_tx_queues); rte_tel_data_add_dict_int(d, "port_id", eth_dev->data->port_id); rte_tel_data_add_dict_int(d, "mtu", eth_dev->data->mtu); - rte_tel_data_add_dict_int(d, "rx_mbuf_size_min", + rte_tel_data_add_dict_u64(d, "rx_mbuf_size_min", eth_dev->data->min_rx_buf_size); - rte_tel_data_add_dict_int(d, "rx_mbuf_alloc_fail", + rte_tel_data_add_dict_u64(d, "rx_mbuf_alloc_fail", eth_dev->data->rx_mbuf_alloc_failed); rte_ether_format_addr(mac_addr, sizeof(mac_addr), eth_dev->data->mac_addrs); @@ -6068,12 +6068,12 @@ eth_dev_handle_port_info(const char *cmd __rte_unused, rte_tel_data_add_dict_container(d, "rxq_state", rxq_state, 0); rte_tel_data_add_dict_container(d, "txq_state", txq_state, 0); rte_tel_data_add_dict_int(d, "numa_node", eth_dev->data->numa_node); - rte_tel_data_add_dict_int(d, "dev_flags", eth_dev->data->dev_flags); - rte_tel_data_add_dict_int(d, "rx_offloads", + rte_tel_data_add_dict_u64(d, "dev_flags", eth_dev->data->dev_flags); + rte_tel_data_add_dict_u64(d, "rx_offloads", eth_dev->data->dev_conf.rxmode.offloads); - rte_tel_data_add_dict_int(d, "tx_offloads", + rte_tel_data_add_dict_u64(d, "tx_offloads", eth_dev->data->dev_conf.txmode.offloads); - rte_tel_data_add_dict_int(d, "ethdev_rss_hf", + rte_tel_data_add_dict_u64(d, "ethdev_rss_hf", eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf); return 0; From patchwork Thu Dec 15 10:31:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 120943 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BCD3FA0543; Thu, 15 Dec 2022 11:32:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CDDD142D24; Thu, 15 Dec 2022 11:31:51 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 96B4140684 for ; Thu, 15 Dec 2022 11:31:46 +0100 (CET) Received: from kwepemm600004.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NXpML3tgkzgZ2G; Thu, 15 Dec 2022 18:27:26 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 15 Dec 2022 18:31:44 +0800 From: Huisong Li To: CC: , , , , , , Subject: [PATCH V6 3/8] mempool: fix possible data truncation and conversion error Date: Thu, 15 Dec 2022 18:31:41 +0800 Message-ID: <20221215103146.816-4-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20221215103146.816-1-lihuisong@huawei.com> References: <20221208080540.62913-1-lihuisong@huawei.com> <20221215103146.816-1-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600004.china.huawei.com (7.193.23.242) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The 'u32' and 'u64' data can not assigned to 'int' type variable. They need to use the 'u64' APIs to add. Fixes: 2f5c4025abb3 ("mempool: add telemetry endpoint") Cc: stable@dpdk.org Signed-off-by: Huisong Li Acked-by: Morten Brørup Acked-by: Chengwen Feng --- lib/mempool/rte_mempool.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c index f33f455790..950d01ffac 100644 --- a/lib/mempool/rte_mempool.c +++ b/lib/mempool/rte_mempool.c @@ -1500,27 +1500,27 @@ mempool_info_cb(struct rte_mempool *mp, void *arg) return; rte_tel_data_add_dict_string(info->d, "name", mp->name); - rte_tel_data_add_dict_int(info->d, "pool_id", mp->pool_id); - rte_tel_data_add_dict_int(info->d, "flags", mp->flags); + rte_tel_data_add_dict_u64(info->d, "pool_id", mp->pool_id); + rte_tel_data_add_dict_u64(info->d, "flags", mp->flags); rte_tel_data_add_dict_int(info->d, "socket_id", mp->socket_id); - rte_tel_data_add_dict_int(info->d, "size", mp->size); - rte_tel_data_add_dict_int(info->d, "cache_size", mp->cache_size); - rte_tel_data_add_dict_int(info->d, "elt_size", mp->elt_size); - rte_tel_data_add_dict_int(info->d, "header_size", mp->header_size); - rte_tel_data_add_dict_int(info->d, "trailer_size", mp->trailer_size); - rte_tel_data_add_dict_int(info->d, "private_data_size", + rte_tel_data_add_dict_u64(info->d, "size", mp->size); + rte_tel_data_add_dict_u64(info->d, "cache_size", mp->cache_size); + rte_tel_data_add_dict_u64(info->d, "elt_size", mp->elt_size); + rte_tel_data_add_dict_u64(info->d, "header_size", mp->header_size); + rte_tel_data_add_dict_u64(info->d, "trailer_size", mp->trailer_size); + rte_tel_data_add_dict_u64(info->d, "private_data_size", mp->private_data_size); rte_tel_data_add_dict_int(info->d, "ops_index", mp->ops_index); - rte_tel_data_add_dict_int(info->d, "populated_size", + rte_tel_data_add_dict_u64(info->d, "populated_size", mp->populated_size); mz = mp->mz; rte_tel_data_add_dict_string(info->d, "mz_name", mz->name); - rte_tel_data_add_dict_int(info->d, "mz_len", mz->len); - rte_tel_data_add_dict_int(info->d, "mz_hugepage_sz", + rte_tel_data_add_dict_u64(info->d, "mz_len", mz->len); + rte_tel_data_add_dict_u64(info->d, "mz_hugepage_sz", mz->hugepage_sz); rte_tel_data_add_dict_int(info->d, "mz_socket_id", mz->socket_id); - rte_tel_data_add_dict_int(info->d, "mz_flags", mz->flags); + rte_tel_data_add_dict_u64(info->d, "mz_flags", mz->flags); } static int From patchwork Thu Dec 15 10:31:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 120942 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AF86AA0543; Thu, 15 Dec 2022 11:32:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E390242D1D; Thu, 15 Dec 2022 11:31:50 +0100 (CET) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id 8B5AD40223 for ; Thu, 15 Dec 2022 11:31:46 +0100 (CET) Received: from kwepemm600004.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NXpR96GvYz16Ldk; Thu, 15 Dec 2022 18:30:45 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 15 Dec 2022 18:31:44 +0800 From: Huisong Li To: CC: , , , , , , Subject: [PATCH V6 4/8] cryptodev: fix possible data conversion error Date: Thu, 15 Dec 2022 18:31:42 +0800 Message-ID: <20221215103146.816-5-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20221215103146.816-1-lihuisong@huawei.com> References: <20221208080540.62913-1-lihuisong@huawei.com> <20221215103146.816-1-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600004.china.huawei.com (7.193.23.242) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The 'u32' data can not assigned to 'int' type variable. The 'u32' data needs to use the 'u64' APIs to add. Fixes: d3d98f5ce9d0 ("cryptodev: support telemetry") Cc: stable@dpdk.org Signed-off-by: Huisong Li Acked-by: Morten Brørup Acked-by: Chengwen Feng --- lib/cryptodev/rte_cryptodev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c index 2165a0688c..515d0df5ce 100644 --- a/lib/cryptodev/rte_cryptodev.c +++ b/lib/cryptodev/rte_cryptodev.c @@ -2692,7 +2692,7 @@ cryptodev_handle_dev_info(const char *cmd __rte_unused, rte_tel_data_start_dict(d); rte_tel_data_add_dict_string(d, "device_name", cryptodev_info.device->name); - rte_tel_data_add_dict_int(d, "max_nb_queue_pairs", + rte_tel_data_add_dict_u64(d, "max_nb_queue_pairs", cryptodev_info.max_nb_queue_pairs); return 0; From patchwork Thu Dec 15 10:31:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 120944 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1AE63A0543; Thu, 15 Dec 2022 11:32:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C109642D29; Thu, 15 Dec 2022 11:31:52 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id D939F40685 for ; Thu, 15 Dec 2022 11:31:46 +0100 (CET) Received: from kwepemm600004.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NXpMM2LWtzgZ2K; Thu, 15 Dec 2022 18:27:27 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 15 Dec 2022 18:31:45 +0800 From: Huisong Li To: CC: , , , , , , Subject: [PATCH V6 5/8] mem: possible data truncation and conversion error Date: Thu, 15 Dec 2022 18:31:43 +0800 Message-ID: <20221215103146.816-6-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20221215103146.816-1-lihuisong@huawei.com> References: <20221208080540.62913-1-lihuisong@huawei.com> <20221215103146.816-1-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600004.china.huawei.com (7.193.23.242) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The 'u32' and 'u64' data can not assigned to 'int' type variable. They need to use the 'u64' APIs to add. Fixes: e6732d0d6e26 ("mem: add telemetry infos") Cc: stable@dpdk.org Signed-off-by: Huisong Li Acked-by: Morten Brørup Acked-by: Chengwen Feng --- lib/eal/common/eal_common_memory.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c index 688dc615d7..8e427bf4b4 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_u64(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); @@ -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_u64(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_u64(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); From patchwork Thu Dec 15 10:31:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 120945 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5FBD3A0543; Thu, 15 Dec 2022 11:32:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ACD7442D2F; Thu, 15 Dec 2022 11:31:53 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 8920640698 for ; Thu, 15 Dec 2022 11:31:47 +0100 (CET) Received: from kwepemm600004.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NXpRG6cTrzJqYj; Thu, 15 Dec 2022 18:30:50 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 15 Dec 2022 18:31:45 +0800 From: Huisong Li To: CC: , , , , , , Subject: [PATCH V6 6/8] telemetry: support adding integer value as hexadecimal Date: Thu, 15 Dec 2022 18:31:44 +0800 Message-ID: <20221215103146.816-7-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20221215103146.816-1-lihuisong@huawei.com> References: <20221208080540.62913-1-lihuisong@huawei.com> <20221215103146.816-1-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600004.china.huawei.com (7.193.23.242) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sometimes displaying a unsigned integer value as hexadecimal encoded style is more expected for human consumption, such as, offload capability and device flag. This patch introduces two APIs to add unsigned integer value as hexadecimal encoded string to array or dictionary. And user can choose whether the stored value is padding to the specified width. Signed-off-by: Huisong Li Acked-by: Morten Brørup Acked-by: Chengwen Feng --- lib/telemetry/rte_telemetry.h | 47 ++++++++++++++++++++++ lib/telemetry/telemetry_data.c | 72 ++++++++++++++++++++++++++++++++++ lib/telemetry/version.map | 9 +++++ 3 files changed, 128 insertions(+) diff --git a/lib/telemetry/rte_telemetry.h b/lib/telemetry/rte_telemetry.h index 40e9a3bf9d..b24f0310ea 100644 --- a/lib/telemetry/rte_telemetry.h +++ b/lib/telemetry/rte_telemetry.h @@ -10,6 +10,7 @@ extern "C" { #endif #include +#include /** Maximum length for string used in object. */ #define RTE_TEL_MAX_STRING_LEN 128 @@ -153,6 +154,28 @@ int rte_tel_data_add_array_container(struct rte_tel_data *d, struct rte_tel_data *val, int keep); +/** + * Convert a unsigned integer to hexadecimal encoded strings and add this string + * to an array. + * The array must have been started by rte_tel_data_start_array() with + * RTE_TEL_STRING_VAL as the type parameter. + * + * @param d + * The data structure passed to the callback + * @param val + * The number to be returned in the array as a hexadecimal encoded strings. + * @param display_bitwidth + * The display bit width of the 'val'. If 'display_bitwidth' is zero, the + * value is stored in the array as no-padding zero hexadecimal encoded string, + * or the value is stored as padding zero to specified hexadecimal width. + * @return + * 0 on success, negative errno on error + */ +__rte_experimental +int +rte_tel_data_add_array_uint_hex(struct rte_tel_data *d, uint64_t val, + uint8_t display_bitwidth); + /** * Add a string value to a dictionary. * The dict must have been started by rte_tel_data_start_dict(). @@ -231,6 +254,30 @@ int rte_tel_data_add_dict_container(struct rte_tel_data *d, const char *name, struct rte_tel_data *val, int keep); +/** + * Convert a unsigned integer to hexadecimal encoded strings and add this string + * to an dictionary. + * The dict must have been started by rte_tel_data_start_dict(). + * + * @param d + * The data structure passed to the callback + * @param name + * The name of the value is to be stored in the dict + * Must contain only alphanumeric characters or the symbols: '_' or '/' + * @param val + * The number to be stored in the dict as a hexadecimal encoded strings. + * @param display_bitwidth + * The display bit width of the 'val'. If 'display_bitwidth' is zero, the + * value is stored in the array as no-padding zero hexadecimal encoded string, + * or the value is stored as padding zero to specified hexadecimal width. + * @return + * 0 on success, negative errno on error + */ +__rte_experimental +int +rte_tel_data_add_dict_uint_hex(struct rte_tel_data *d, const char *name, + uint64_t val, uint8_t display_bitwidth); + /** * This telemetry callback is used when registering a telemetry command. * It handles getting and formatting information to be returned to telemetry diff --git a/lib/telemetry/telemetry_data.c b/lib/telemetry/telemetry_data.c index 34366ecee3..2a4dcec30a 100644 --- a/lib/telemetry/telemetry_data.c +++ b/lib/telemetry/telemetry_data.c @@ -4,6 +4,7 @@ #include #include +#include #undef RTE_USE_LIBBSD #include @@ -12,6 +13,8 @@ #include "telemetry_data.h" +#define RTE_TEL_UINT_HEX_STR_BUF_LEN 64 + int rte_tel_data_start_array(struct rte_tel_data *d, enum rte_tel_value_type type) { @@ -97,6 +100,59 @@ rte_tel_data_add_array_container(struct rte_tel_data *d, return 0; } +/* To suppress compiler warning about format string. */ +#if defined(RTE_TOOLCHAIN_GCC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" +#elif defined(RTE_TOOLCHAIN_CLANG) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wformat-nonliteral" +#endif + +static int +rte_tel_uint_to_hex_encoded_str(char *buf, uint16_t len, uint64_t val, + uint8_t display_bitwidth) +{ +#define RTE_TEL_UINT_HEX_FORMAT_LEN 16 + + uint8_t spec_hex_width = (display_bitwidth + 3) / 4; + char format[RTE_TEL_UINT_HEX_FORMAT_LEN]; + + /* Buffer needs to have room to contain the prefix '0x' and '\0'. */ + if (len < spec_hex_width + 3) + return -EINVAL; + + if (display_bitwidth != 0) { + sprintf(format, "0x%%0%u" PRIx64, spec_hex_width); + sprintf(buf, format, val); + } else { + sprintf(buf, "0x%" PRIx64, val); + } + + return 0; +} + +#if defined(RTE_TOOLCHAIN_GCC) +#pragma GCC diagnostic pop +#elif defined(RTE_TOOLCHAIN_CLANG) +#pragma clang diagnostic pop +#endif + +int +rte_tel_data_add_array_uint_hex(struct rte_tel_data *d, uint64_t val, + uint8_t display_bitwidth) +{ + char hex_str[RTE_TEL_UINT_HEX_STR_BUF_LEN]; + int ret; + + ret = rte_tel_uint_to_hex_encoded_str(hex_str, + RTE_TEL_UINT_HEX_STR_BUF_LEN, val, display_bitwidth); + if (ret != 0) + return ret; + + return rte_tel_data_add_array_string(d, hex_str); +} + static bool valid_name(const char *name) { @@ -204,6 +260,22 @@ rte_tel_data_add_dict_container(struct rte_tel_data *d, const char *name, return bytes < RTE_TEL_MAX_STRING_LEN ? 0 : E2BIG; } +int +rte_tel_data_add_dict_uint_hex(struct rte_tel_data *d, const char *name, + uint64_t val, uint8_t display_bitwidth) +{ + char hex_str[RTE_TEL_UINT_HEX_STR_BUF_LEN]; + int ret; + + ret = rte_tel_uint_to_hex_encoded_str(hex_str, + RTE_TEL_UINT_HEX_STR_BUF_LEN, val, display_bitwidth); + if (ret != 0) + return ret; + + + return rte_tel_data_add_dict_string(d, name, hex_str); +} + struct rte_tel_data * rte_tel_data_alloc(void) { diff --git a/lib/telemetry/version.map b/lib/telemetry/version.map index 9794f9ea20..951bd63974 100644 --- a/lib/telemetry/version.map +++ b/lib/telemetry/version.map @@ -1,3 +1,12 @@ +EXPERIMENTAL { + global: + + rte_tel_data_add_array_uint_hex; + rte_tel_data_add_dict_uint_hex; + + local: *; +}; + DPDK_23 { global: From patchwork Thu Dec 15 10:31:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 120947 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DBBA3A0543; Thu, 15 Dec 2022 11:32:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8473842D3B; Thu, 15 Dec 2022 11:31:55 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id EF8C040DF6 for ; Thu, 15 Dec 2022 11:31:47 +0100 (CET) Received: from kwepemm600004.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NXpR80jJLzRq2t; Thu, 15 Dec 2022 18:30:44 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 15 Dec 2022 18:31:46 +0800 From: Huisong Li To: CC: , , , , , , Subject: [PATCH V6 7/8] test: add test cases for adding hex integer value API Date: Thu, 15 Dec 2022 18:31:45 +0800 Message-ID: <20221215103146.816-8-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20221215103146.816-1-lihuisong@huawei.com> References: <20221208080540.62913-1-lihuisong@huawei.com> <20221215103146.816-1-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600004.china.huawei.com (7.193.23.242) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add test cases for adding hexadecimal unsigned integer value API. Signed-off-by: Huisong Li Acked-by: Morten Brørup Acked-by: Chengwen Feng --- app/test/test_telemetry_data.c | 150 +++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) diff --git a/app/test/test_telemetry_data.c b/app/test/test_telemetry_data.c index d92667a527..e930457f4d 100644 --- a/app/test/test_telemetry_data.c +++ b/app/test/test_telemetry_data.c @@ -209,6 +209,39 @@ test_case_add_dict_string(void) return CHECK_OUTPUT("{\"dict_0\":\"aaaa\",\"dict_1\":\"bbbb\",\"dict_2\":\"cccc\",\"dict_3\":\"dddd\"}"); } +static int +test_case_add_dict_uint_hex_padding(void) +{ + rte_tel_data_start_dict(&response_data); + + rte_tel_data_add_dict_uint_hex(&response_data, "dict_0", + (uint8_t)0x8, 8); + rte_tel_data_add_dict_uint_hex(&response_data, "dict_1", + (uint16_t)0x88, 16); + rte_tel_data_add_dict_uint_hex(&response_data, "dict_2", + (uint32_t)0x888, 32); + rte_tel_data_add_dict_uint_hex(&response_data, "dict_3", + (uint64_t)0x8888, 64); + + return CHECK_OUTPUT("{\"dict_0\":\"0x08\",\"dict_1\":\"0x0088\",\"dict_2\":\"0x00000888\",\"dict_3\":\"0x0000000000008888\"}"); +} + +static int +test_case_add_dict_uint_hex_nopadding(void) +{ + rte_tel_data_start_dict(&response_data); + + rte_tel_data_add_dict_uint_hex(&response_data, "dict_0", + (uint8_t)0x8, 0); + rte_tel_data_add_dict_uint_hex(&response_data, "dict_1", + (uint16_t)0x88, 0); + rte_tel_data_add_dict_uint_hex(&response_data, "dict_2", + (uint32_t)0x888, 0); + rte_tel_data_add_dict_uint_hex(&response_data, "dict_3", + (uint64_t)0x8888, 0); + + return CHECK_OUTPUT("{\"dict_0\":\"0x8\",\"dict_1\":\"0x88\",\"dict_2\":\"0x888\",\"dict_3\":\"0x8888\"}"); +} static int test_dict_with_array_string_values(void) @@ -232,6 +265,50 @@ test_dict_with_array_string_values(void) return CHECK_OUTPUT("{\"dict_0\":[\"aaaa\"],\"dict_1\":[\"bbbb\"]}"); } +static int +test_dict_with_array_uint_hex_values_padding(void) +{ + struct rte_tel_data *child_data = rte_tel_data_alloc(); + rte_tel_data_start_array(child_data, RTE_TEL_STRING_VAL); + + struct rte_tel_data *child_data2 = rte_tel_data_alloc(); + rte_tel_data_start_array(child_data2, RTE_TEL_STRING_VAL); + + rte_tel_data_start_dict(&response_data); + + rte_tel_data_add_array_uint_hex(child_data, (uint32_t)0x888, 32); + rte_tel_data_add_array_uint_hex(child_data2, (uint64_t)0x8888, 64); + + rte_tel_data_add_dict_container(&response_data, "dict_0", + child_data, 0); + rte_tel_data_add_dict_container(&response_data, "dict_1", + child_data2, 0); + + return CHECK_OUTPUT("{\"dict_0\":[\"0x00000888\"],\"dict_1\":[\"0x0000000000008888\"]}"); +} + +static int +test_dict_with_array_uint_hex_values_nopadding(void) +{ + struct rte_tel_data *child_data = rte_tel_data_alloc(); + rte_tel_data_start_array(child_data, RTE_TEL_STRING_VAL); + + struct rte_tel_data *child_data2 = rte_tel_data_alloc(); + rte_tel_data_start_array(child_data2, RTE_TEL_STRING_VAL); + + rte_tel_data_start_dict(&response_data); + + rte_tel_data_add_array_uint_hex(child_data, (uint32_t)0x888, 0); + rte_tel_data_add_array_uint_hex(child_data2, (uint64_t)0x8888, 0); + + rte_tel_data_add_dict_container(&response_data, "dict_0", + child_data, 0); + rte_tel_data_add_dict_container(&response_data, "dict_1", + child_data2, 0); + + return CHECK_OUTPUT("{\"dict_0\":[\"0x888\"],\"dict_1\":[\"0x8888\"]}"); +} + static int test_dict_with_dict_values(void) { @@ -278,6 +355,47 @@ test_array_with_array_string_values(void) return CHECK_OUTPUT("[[\"aaaa\"],[\"bbbb\"]]"); } +static int +test_array_with_array_uint_hex_values_padding(void) +{ + struct rte_tel_data *child_data = rte_tel_data_alloc(); + rte_tel_data_start_array(child_data, RTE_TEL_STRING_VAL); + + struct rte_tel_data *child_data2 = rte_tel_data_alloc(); + rte_tel_data_start_array(child_data2, RTE_TEL_STRING_VAL); + + rte_tel_data_start_array(&response_data, RTE_TEL_CONTAINER); + + rte_tel_data_add_array_uint_hex(child_data, (uint32_t)0x888, 32); + rte_tel_data_add_array_uint_hex(child_data2, (uint64_t)0x8888, 64); + + rte_tel_data_add_array_container(&response_data, child_data, 0); + rte_tel_data_add_array_container(&response_data, child_data2, 0); + + return CHECK_OUTPUT("[[\"0x00000888\"],[\"0x0000000000008888\"]]"); +} + + +static int +test_array_with_array_uint_hex_values_nopadding(void) +{ + struct rte_tel_data *child_data = rte_tel_data_alloc(); + rte_tel_data_start_array(child_data, RTE_TEL_STRING_VAL); + + struct rte_tel_data *child_data2 = rte_tel_data_alloc(); + rte_tel_data_start_array(child_data2, RTE_TEL_STRING_VAL); + + rte_tel_data_start_array(&response_data, RTE_TEL_CONTAINER); + + rte_tel_data_add_array_uint_hex(child_data, (uint32_t)0x888, 0); + rte_tel_data_add_array_uint_hex(child_data2, (uint64_t)0x8888, 0); + + rte_tel_data_add_array_container(&response_data, child_data, 0); + rte_tel_data_add_array_container(&response_data, child_data2, 0); + + return CHECK_OUTPUT("[[\"0x888\"],[\"0x8888\"]]"); +} + static int test_case_array_u64(void) { @@ -289,6 +407,30 @@ test_case_array_u64(void) return CHECK_OUTPUT("[0,1,2,3,4]"); } +static int +test_case_array_uint_hex_padding(void) +{ + rte_tel_data_start_array(&response_data, RTE_TEL_STRING_VAL); + rte_tel_data_add_array_uint_hex(&response_data, (uint8_t)0x8, 8); + rte_tel_data_add_array_uint_hex(&response_data, (uint16_t)0x88, 16); + rte_tel_data_add_array_uint_hex(&response_data, (uint32_t)0x888, 32); + rte_tel_data_add_array_uint_hex(&response_data, (uint64_t)0x8888, 64); + + return CHECK_OUTPUT("[\"0x08\",\"0x0088\",\"0x00000888\",\"0x0000000000008888\"]"); +} + +static int +test_case_array_uint_hex_nopadding(void) +{ + rte_tel_data_start_array(&response_data, RTE_TEL_STRING_VAL); + rte_tel_data_add_array_uint_hex(&response_data, (uint8_t)0x8, 0); + rte_tel_data_add_array_uint_hex(&response_data, (uint16_t)0x88, 0); + rte_tel_data_add_array_uint_hex(&response_data, (uint32_t)0x888, 0); + rte_tel_data_add_array_uint_hex(&response_data, (uint64_t)0x8888, 0); + + return CHECK_OUTPUT("[\"0x8\",\"0x88\",\"0x888\",\"0x8888\"]"); +} + static int test_case_add_dict_u64(void) { @@ -429,15 +571,23 @@ telemetry_data_autotest(void) test_simple_string, test_case_array_string, test_case_array_int, test_case_array_u64, + test_case_array_uint_hex_padding, + test_case_array_uint_hex_nopadding, test_case_add_dict_int, test_case_add_dict_u64, test_case_add_dict_string, + test_case_add_dict_uint_hex_padding, + test_case_add_dict_uint_hex_nopadding, test_dict_with_array_int_values, test_dict_with_array_u64_values, test_dict_with_array_string_values, + test_dict_with_array_uint_hex_values_padding, + test_dict_with_array_uint_hex_values_nopadding, test_dict_with_dict_values, test_array_with_array_int_values, test_array_with_array_u64_values, test_array_with_array_string_values, + test_array_with_array_uint_hex_values_padding, + test_array_with_array_uint_hex_values_nopadding, test_string_char_escaping, test_array_char_escaping, test_dict_char_escaping, From patchwork Thu Dec 15 10:31:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 120946 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A469DA0543; Thu, 15 Dec 2022 11:32:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96C2C42D35; Thu, 15 Dec 2022 11:31:54 +0100 (CET) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id 0BFFF410EA for ; Thu, 15 Dec 2022 11:31:48 +0100 (CET) Received: from kwepemm600004.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NXpRC38chz16Lcj; Thu, 15 Dec 2022 18:30:47 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 15 Dec 2022 18:31:46 +0800 From: Huisong Li To: CC: , , , , , , Subject: [PATCH V6 8/8] ethdev: display capability values in hexadecimal format Date: Thu, 15 Dec 2022 18:31:46 +0800 Message-ID: <20221215103146.816-9-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20221215103146.816-1-lihuisong@huawei.com> References: <20221208080540.62913-1-lihuisong@huawei.com> <20221215103146.816-1-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600004.china.huawei.com (7.193.23.242) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The 'dev_flags', 'rx_offloads', 'tx_offloads' and 'rss_hf' are better displayed in hexadecimal format. Like: -->old display by input /ethdev/info,0 "dev_flags": 3, "rx_offloads": 524288, "tx_offloads": 65536, "ethdev_rss_hf": 9100 --> now display "dev_flags": "0x3", "rx_offloads": "0x80000", "tx_offloads": "0x10000", "ethdev_rss_hf": "0x238c" Signed-off-by: Huisong Li Acked-by: Morten Brørup Acked-by: Chengwen Feng --- lib/ethdev/rte_ethdev.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index a40d396677..3e3b7febaa 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -6068,13 +6068,14 @@ eth_dev_handle_port_info(const char *cmd __rte_unused, rte_tel_data_add_dict_container(d, "rxq_state", rxq_state, 0); rte_tel_data_add_dict_container(d, "txq_state", txq_state, 0); rte_tel_data_add_dict_int(d, "numa_node", eth_dev->data->numa_node); - rte_tel_data_add_dict_u64(d, "dev_flags", eth_dev->data->dev_flags); - rte_tel_data_add_dict_u64(d, "rx_offloads", - eth_dev->data->dev_conf.rxmode.offloads); - rte_tel_data_add_dict_u64(d, "tx_offloads", - eth_dev->data->dev_conf.txmode.offloads); - rte_tel_data_add_dict_u64(d, "ethdev_rss_hf", - eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf); + rte_tel_data_add_dict_uint_hex(d, "dev_flags", + eth_dev->data->dev_flags, 0); + rte_tel_data_add_dict_uint_hex(d, "rx_offloads", + eth_dev->data->dev_conf.rxmode.offloads, 0); + rte_tel_data_add_dict_uint_hex(d, "tx_offloads", + eth_dev->data->dev_conf.txmode.offloads, 0); + rte_tel_data_add_dict_uint_hex(d, "ethdev_rss_hf", + eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf, 0); return 0; }