1 Star 0 Fork 75

sky/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0271-ethdev-fix-telemetry-data-truncation.patch 2.38 KB
一键复制 编辑 原始数据 按行查看 历史
From f4f89120a7df52f92fcac89e3fe13cfac1097051 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Mon, 19 Dec 2022 15:06:42 +0800
Subject: ethdev: fix telemetry data truncation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ upstream commit 7db3f2af573287abb9201d46a92b4ca3ebc5d9ad ]
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 <lihuisong@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
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 d82819a458..c216091e79 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -6397,9 +6397,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);
@@ -6428,12 +6428,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;
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/nlgwcy/dpdk.git
git@gitee.com:nlgwcy/dpdk.git
nlgwcy
dpdk
dpdk
master

搜索帮助