1 Star 0 Fork 75

sky/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0367-telemetry-fix-repeat-display-when-callback-don-t-init-dict.patch 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
huangdengdui 提交于 2023-11-20 17:28 . sync some patchs from upstreaming
From 0ba973a96681d5c5f85423176d63c14f8cbc1c25 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 9 Feb 2023 01:25:33 +0000
Subject: [PATCH 367/394] telemetry: fix repeat display when callback don't
init dict
[ upstream commit ff50c4f9136781bae9089c596e0a12d113e1d474 ]
When a telemetry callback doesn't initialize the telemetry data
structure and returns a non-negative number, the telemetry will repeat
to display the last result. This patch zero the data structure to avoid
the problem.
Fixes: 6dd571fd07c3 ("telemetry: introduce new functionality")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/telemetry/telemetry.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index 52048de55c..2c12db20cb 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -332,7 +332,7 @@ output_json(const char *cmd, const struct rte_tel_data *d, int s)
static void
perform_command(telemetry_cb fn, const char *cmd, const char *param, int s)
{
- struct rte_tel_data data;
+ struct rte_tel_data data = {0};
int ret = fn(cmd, param, &data);
if (ret < 0) {
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/nlgwcy/dpdk.git
git@gitee.com:nlgwcy/dpdk.git
nlgwcy
dpdk
dpdk
master

搜索帮助