From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 782C143835 for ; Tue, 5 Mar 2024 16:36:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 354FA42E98; Tue, 5 Mar 2024 16:36:31 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 62FD142E51 for ; Tue, 5 Mar 2024 16:36:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709652987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K+rlTEd/7reFq+BR9S4t0L7PfUEq352kDglTdOJyRFM=; b=bo8dEPx4PUvSLb7/qLap+fTzqM0H/KratdKtG1Jvj4amzX9hMT4We0o+56S/hr+DLFyX3R K6eKts/oi19RHhdud/OJzTCXNXah8uEzaG6vlO8wPU93BIVPdbPiJkQxl1FaYaz2N3XS36 Yt5bDWJtoYaSNNuKkyPUKQoNBTld1Vs= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-65-NPrfT5pcPpC4vkkCspvM9g-1; Tue, 05 Mar 2024 10:36:24 -0500 X-MC-Unique: NPrfT5pcPpC4vkkCspvM9g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7DEEF1C01E8C; Tue, 5 Mar 2024 15:36:24 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.194.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF849200AFA2; Tue, 5 Mar 2024 15:36:23 +0000 (UTC) From: Kevin Traynor To: Jonathan Erb Cc: Ciara Power , dpdk stable Subject: patch 'telemetry: fix empty JSON dictionaries' has been queued to stable release 21.11.7 Date: Tue, 5 Mar 2024 15:34:44 +0000 Message-ID: <20240305153449.263666-71-ktraynor@redhat.com> In-Reply-To: <20240305153449.263666-1-ktraynor@redhat.com> References: <20240305153449.263666-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 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 Acked-by: Ciara Power --- .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 John W. Linville Jonas Pfefferle -Jonathan Erb +(??)Jonathan Erb Jonathan Tsai Jon DeVree 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@dpdk.org @@ -23 +24 @@ -index a0756974e2..de339562f4 100644 +index 8cb4e2f619..7776e85d57 100644 @@ -26 +27 @@ -@@ -677,5 +677,5 @@ John Romein +@@ -653,5 +653,5 @@ John Ousterhout @@ -29,2 +30,2 @@ --Jonathan Erb -+Jonathan Erb +-Jonathan Erb ++(??)Jonathan Erb @@ -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)