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 1578243C60 for ; Thu, 7 Mar 2024 02:33:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0CCBD42E7A; Thu, 7 Mar 2024 02:33:20 +0100 (CET) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mails.dpdk.org (Postfix) with ESMTP id 877DF40261 for ; Thu, 7 Mar 2024 02:33:18 +0100 (CET) Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-33d146737e6so194270f8f.0 for ; Wed, 06 Mar 2024 17:33:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709775198; x=1710379998; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3rJsPpAQ83JDbiG2bgbFHamD1IqkdIyX0RgWU3miCYs=; b=EaY9+JyEIcR5mvCrcfQOIAKDeZwiYyHg2hSQQuKT8JwxnRNp00H+wELVKgidVHb3Oi 36uLgQELbKyz9I+eiUcYQ6d37REw1rtxkPd34OJdw6lRHp3wCZ9MW4RC4hje6xQhAKCI +EOv+J/3I6B0iEnlUim41IVKAECzm73kzRUGojLgfCAZ9Y5VJiJiJoWR5NNYISQ6o3Au tslP/2v7czgvaAkuVqwqx6fLDVJ0eu3EOFpkM2PtfO3LM2T68r4pNxtQfX2eF4CK7len MqILjQT1A5nzmxxgzVIolzJTYC425fX5N8BmTy7TfTKsApFVISKKXfEr2s0Gl8nFRuFt BfFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709775198; x=1710379998; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3rJsPpAQ83JDbiG2bgbFHamD1IqkdIyX0RgWU3miCYs=; b=ZTw0HpDfdAwMPLfl9bllz7Z3daK0VgkPptaF62KLl9CwxvKKp0gX7hv0V3aW8nro+6 3n456skbJanBvoPkUz7JmE2M5BdZkd48lMUFY86SWman+r5JFLjaSCNhFqUg/aifeG2a Rjlu0F+kZ0yqGxlviR9IFIwrZS+MBdsjnkbD2gPPODj9K06yC6zaEiQqhuqTdRbZjYKw oT0U0284gzMhG6kxP6yrSK6pZ/eAJ9JQdEWXluxjTLvdxBK0j/QPLnojLjgKbrlcObtO kQdElfmmGB4oaX0qmwkJDoP6dL7twp7cW0ZOHdvGMqsEo7OIPAU0NBefDh1ZqniWEUvb DjgA== X-Forwarded-Encrypted: i=1; AJvYcCUp7Phleage23BLa+xqAoO8I7MPjojsFc9WVw1k9XUkOGEIB50aymeuGQ9R49jdFSeLqxOs6bDEXKvrLRcMLco= X-Gm-Message-State: AOJu0Yxbpl9QoQVVqF99oRTuvqKY6NCKDnEjX4rjmnCROpDBL5yOBNT/ 2emPgkV7qZ1AQqZ9Tcqtkhi1dv68r2Alby1z3Yt99PPC7IPS986fvT76lHO8 X-Google-Smtp-Source: AGHT+IFH/FMFxX1RUejGcMAU+eiQ7mnaV5dt3MDmHK0pIaN3hB43AFpX1B+nEC3iEcJZnhaoL80DGQ== X-Received: by 2002:a5d:48d1:0:b0:33d:b2f8:28fc with SMTP id p17-20020a5d48d1000000b0033db2f828fcmr10963236wrs.55.1709775198121; Wed, 06 Mar 2024 17:33:18 -0800 (PST) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id er15-20020a05600c84cf00b00412ff07df2bsm849733wmb.37.2024.03.06.17.33.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 17:33:17 -0800 (PST) From: luca.boccassi@gmail.com To: Jonathan Erb Cc: Ciara Power , dpdk stable Subject: patch 'telemetry: fix empty JSON dictionaries' has been queued to stable release 22.11.5 Date: Thu, 7 Mar 2024 01:30:34 +0000 Message-Id: <20240307013159.1735343-17-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307013159.1735343-1-luca.boccassi@gmail.com> References: <20240307013159.1735343-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 22.11.5 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/09/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/1d8abba66121dd057182e9f690b2c3b62dc15e7a Thanks. Luca Boccassi --- >From 1d8abba66121dd057182e9f690b2c3b62dc15e7a 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 6546656551..0af93036f2 100644 --- a/.mailmap +++ b/.mailmap @@ -652,7 +652,7 @@ John Ousterhout John Romein John W. Linville Jonas Pfefferle -Jonathan Erb +Jonathan Erb Jonathan Tsai Jon DeVree Jon Loeliger diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c index b7fd6f606c..af5da11866 100644 --- a/lib/telemetry/telemetry.c +++ b/lib/telemetry/telemetry.c @@ -171,7 +171,11 @@ container_to_json(const struct rte_tel_data *d, char *out_buf, size_t buf_len) d->type != RTE_TEL_ARRAY_INT && d->type != RTE_TEL_ARRAY_STRING) 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++) used = rte_tel_json_add_array_u64(out_buf, -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-07 01:05:36.522346361 +0000 +++ 0017-telemetry-fix-empty-JSON-dictionaries.patch 2024-03-07 01:05:34.690937724 +0000 @@ -1 +1 @@ -From 324ec1df541711ca829f4d99b7e2d32ffe38d3ca Mon Sep 17 00:00:00 2001 +From 1d8abba66121dd057182e9f690b2c3b62dc15e7a 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 6546656551..0af93036f2 100644 @@ -26 +27 @@ -@@ -676,7 +676,7 @@ John Ousterhout +@@ -652,7 +652,7 @@ John Ousterhout @@ -36 +37 @@ -index d4720197ba..1663bd8c68 100644 +index b7fd6f606c..af5da11866 100644 @@ -39,2 +40,2 @@ -@@ -170,7 +170,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) +@@ -171,7 +171,11 @@ container_to_json(const struct rte_tel_data *d, char *out_buf, size_t buf_len) + d->type != RTE_TEL_ARRAY_INT && d->type != RTE_TEL_ARRAY_STRING) @@ -44 +45 @@ -+ if (d->type == TEL_DICT) ++ if (d->type == RTE_TEL_DICT) @@ -49 +50 @@ - if (d->type == TEL_ARRAY_UINT) + if (d->type == RTE_TEL_ARRAY_U64) @@ -51 +52 @@ - used = rte_tel_json_add_array_uint(out_buf, + used = rte_tel_json_add_array_u64(out_buf,