patch 'telemetry: fix empty JSON dictionaries' has been queued to stable release 21.11.7

Kevin Traynor ktraynor at redhat.com
Tue Mar 5 16:34:44 CET 2024


Hi,

FYI, your patch has been queued to stable release 21.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/11/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/a5224aa51717e08700862bb16a5711f3bedb6350

Thanks.

Kevin

---
>From a5224aa51717e08700862bb16a5711f3bedb6350 Mon Sep 17 00:00:00 2001
From: Jonathan Erb <jonathan.erb at threater.com>
Date: Thu, 18 Jan 2024 12:26:02 -0500
Subject: [PATCH] telemetry: fix empty JSON dictionaries

[ upstream commit 324ec1df541711ca829f4d99b7e2d32ffe38d3ca ]

Fix to allow telemetry to handle empty dictionaries correctly.

This patch resolves an issue where empty dictionaries are reported
by telemetry as '[]' rather than '{}'. Initializing the output
buffer based on the container type resolves the issue.

Fixes: c933bb5177ca ("telemetry: support array values in data object")

Signed-off-by: Jonathan Erb <jonathan.erb at threater.com>
Acked-by: Ciara Power <ciara.power at intel.com>
---
 .mailmap                  | 2 +-
 lib/telemetry/telemetry.c | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/.mailmap b/.mailmap
index 8cb4e2f619..7776e85d57 100644
--- a/.mailmap
+++ b/.mailmap
@@ -653,5 +653,5 @@ John Ousterhout <ouster at cs.stanford.edu>
 John W. Linville <linville at tuxdriver.com>
 Jonas Pfefferle <jpf at zurich.ibm.com> <pepperjo at japf.ch>
-Jonathan Erb <jonathan.erb at banduracyber.com>
+(??)Jonathan Erb <jonathan.erb at threatblockr.com> <jonathan.erb at banduracyber.com>
 Jonathan Tsai <jonathan1.tsai at intel.com>
 Jon DeVree <nuxi at vault24.org>
diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index 075672d91d..36cdec26ef 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -161,5 +161,9 @@ container_to_json(const struct rte_tel_data *d, char *out_buf, size_t buf_len)
 		return snprintf(out_buf, buf_len, "null");
 
-	used = rte_tel_json_empty_array(out_buf, buf_len, 0);
+	if (d->type == RTE_TEL_DICT)
+		used = rte_tel_json_empty_obj(out_buf, buf_len, 0);
+	else
+		used = rte_tel_json_empty_array(out_buf, buf_len, 0);
+
 	if (d->type == RTE_TEL_ARRAY_U64)
 		for (i = 0; i < d->data_len; i++)
-- 
2.43.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 14:08:56.337499329 +0000
+++ 0071-telemetry-fix-empty-JSON-dictionaries.patch	2024-03-05 14:08:54.760521056 +0000
@@ -1 +1 @@
-From 324ec1df541711ca829f4d99b7e2d32ffe38d3ca Mon Sep 17 00:00:00 2001
+From a5224aa51717e08700862bb16a5711f3bedb6350 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 324ec1df541711ca829f4d99b7e2d32ffe38d3ca ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index a0756974e2..de339562f4 100644
+index 8cb4e2f619..7776e85d57 100644
@@ -26 +27 @@
-@@ -677,5 +677,5 @@ John Romein <romein at astron.nl>
+@@ -653,5 +653,5 @@ John Ousterhout <ouster at cs.stanford.edu>
@@ -29,2 +30,2 @@
--Jonathan Erb <jonathan.erb at threatblockr.com> <jonathan.erb at banduracyber.com>
-+Jonathan Erb <jonathan.erb at threater.com> <jonathan.erb at threatblockr.com> <jonathan.erb at banduracyber.com>
+-Jonathan Erb <jonathan.erb at banduracyber.com>
++(??)Jonathan Erb <jonathan.erb at threatblockr.com> <jonathan.erb at banduracyber.com>
@@ -34 +35 @@
-index d4720197ba..1663bd8c68 100644
+index 075672d91d..36cdec26ef 100644
@@ -37 +38 @@
-@@ -171,5 +171,9 @@ container_to_json(const struct rte_tel_data *d, char *out_buf, size_t buf_len)
+@@ -161,5 +161,9 @@ container_to_json(const struct rte_tel_data *d, char *out_buf, size_t buf_len)
@@ -41 +42 @@
-+	if (d->type == TEL_DICT)
++	if (d->type == RTE_TEL_DICT)
@@ -46 +47 @@
- 	if (d->type == TEL_ARRAY_UINT)
+ 	if (d->type == RTE_TEL_ARRAY_U64)



More information about the stable mailing list