DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH dpdk] telemetry: fix adding dicts in container arrays
@ 2026-01-07 21:51 Robin Jarry
  2026-01-08  9:20 ` Bruce Richardson
  2026-01-08 10:50 ` [PATCH dpdk v2] " Robin Jarry
  0 siblings, 2 replies; 5+ messages in thread
From: Robin Jarry @ 2026-01-07 21:51 UTC (permalink / raw)
  To: dev, Bruce Richardson, Ciara Power

Currently, adding TEL_DICT containers in TEL_ARRAY_CONTAINER containers
is not supported by rte_tel_data_add_array_container. It wrongfully
returns -EINVAL where it should allow it.

This is supported by the JSON formatter.

Allow the same value types than rte_tel_data_add_dict_container().

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

Signed-off-by: Robin Jarry <rjarry@redhat.com>
---
 lib/telemetry/telemetry_data.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/telemetry/telemetry_data.c b/lib/telemetry/telemetry_data.c
index 0354a0654804..0a006559ab42 100644
--- a/lib/telemetry/telemetry_data.c
+++ b/lib/telemetry/telemetry_data.c
@@ -96,10 +96,10 @@ int
 rte_tel_data_add_array_container(struct rte_tel_data *d,
 		struct rte_tel_data *val, int keep)
 {
-	if (d->type != TEL_ARRAY_CONTAINER ||
-			(val->type != TEL_ARRAY_UINT
+	if (d->type != TEL_ARRAY_CONTAINER || (val->type != TEL_ARRAY_UINT
 			&& val->type != TEL_ARRAY_INT
-			&& val->type != TEL_ARRAY_STRING))
+			&& val->type != TEL_ARRAY_STRING
+			&& val->type != TEL_DICT))
 		return -EINVAL;
 	if (d->data_len >= RTE_TEL_MAX_ARRAY_ENTRIES)
 		return -ENOSPC;
-- 
2.52.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-01-08 11:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-07 21:51 [PATCH dpdk] telemetry: fix adding dicts in container arrays Robin Jarry
2026-01-08  9:20 ` Bruce Richardson
2026-01-08 10:50 ` [PATCH dpdk v2] " Robin Jarry
2026-01-08 11:06   ` Bruce Richardson
2026-01-08 11:07   ` Bruce Richardson

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).