* [PATCH] telemetry: fix repeat display when callback don't init dict
@ 2023-02-09 1:25 Chengwen Feng
2023-02-09 7:41 ` David Marchand
0 siblings, 1 reply; 2+ messages in thread
From: Chengwen Feng @ 2023-02-09 1:25 UTC (permalink / raw)
To: thomas, ferruh.yigit; +Cc: dev, ciara.power, bruce.richardson
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 655191bcf1..7bceadcee7 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -333,7 +333,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.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] telemetry: fix repeat display when callback don't init dict
2023-02-09 1:25 [PATCH] telemetry: fix repeat display when callback don't init dict Chengwen Feng
@ 2023-02-09 7:41 ` David Marchand
0 siblings, 0 replies; 2+ messages in thread
From: David Marchand @ 2023-02-09 7:41 UTC (permalink / raw)
To: Chengwen Feng
Cc: thomas, ferruh.yigit, dev, ciara.power, bruce.richardson, Robin Jarry
On Thu, Feb 9, 2023 at 2:31 AM Chengwen Feng <fengchengwen@huawei.com> wrote:
>
> 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>
Applied, thanks.
--
David Marchand
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-09 7:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-09 1:25 [PATCH] telemetry: fix repeat display when callback don't init dict Chengwen Feng
2023-02-09 7:41 ` David Marchand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).