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

Xueming Li xuemingl at nvidia.com
Tue Mar 5 10:46:02 CET 2024


Hi,

FYI, your patch has been queued to stable release 23.11.1

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/31/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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=b5c580913f3fd171f6324940b978bca487c36fc4

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From b5c580913f3fd171f6324940b978bca487c36fc4 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
Cc: Xueming Li <xuemingl at nvidia.com>

[ 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 8d8f5b1b5d..bff68cefd8 100644
--- a/.mailmap
+++ b/.mailmap
@@ -675,7 +675,7 @@ John Ousterhout <ouster at cs.stanford.edu>
 John Romein <romein at astron.nl>
 John W. Linville <linville at tuxdriver.com>
 Jonas Pfefferle <jpf at zurich.ibm.com> <pepperjo at japf.ch>
-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 Tsai <jonathan1.tsai at intel.com>
 Jon DeVree <nuxi at vault24.org>
 Jon Loeliger <jdl at netgate.com>
diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index ee4718a4b3..88d6410980 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -169,7 +169,11 @@ container_to_json(const struct rte_tel_data *d, char *out_buf, size_t buf_len)
 		d->type != TEL_ARRAY_INT && d->type != TEL_ARRAY_STRING)
 		return snprintf(out_buf, buf_len, "null");

-	used = rte_tel_json_empty_array(out_buf, buf_len, 0);
+	if (d->type == 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 == TEL_ARRAY_UINT)
 		for (i = 0; i < d->data_len; i++)
 			used = rte_tel_json_add_array_uint(out_buf,
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.721663925 +0800
+++ 0021-telemetry-fix-empty-JSON-dictionaries.patch	2024-03-05 17:39:30.703566491 +0800
@@ -1 +1 @@
-From 324ec1df541711ca829f4d99b7e2d32ffe38d3ca Mon Sep 17 00:00:00 2001
+From b5c580913f3fd171f6324940b978bca487c36fc4 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 324ec1df541711ca829f4d99b7e2d32ffe38d3ca ]
@@ -13 +15,0 @@
-Cc: stable at dpdk.org
@@ -23 +25 @@
-index a0756974e2..de339562f4 100644
+index 8d8f5b1b5d..bff68cefd8 100644
@@ -26 +28 @@
-@@ -676,7 +676,7 @@ John Ousterhout <ouster at cs.stanford.edu>
+@@ -675,7 +675,7 @@ John Ousterhout <ouster at cs.stanford.edu>
@@ -36 +38 @@
-index d4720197ba..1663bd8c68 100644
+index ee4718a4b3..88d6410980 100644
@@ -39 +41 @@
-@@ -170,7 +170,11 @@ container_to_json(const struct rte_tel_data *d, char *out_buf, size_t buf_len)
+@@ -169,7 +169,11 @@ container_to_json(const struct rte_tel_data *d, char *out_buf, size_t buf_len)


More information about the stable mailing list