[dpdk-stable] patch 'telemetry: fix JSON output buffer length' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:30:07 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/12/21. 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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/aa4a2ef3fee892f204a04bef2329e65775510f38

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From aa4a2ef3fee892f204a04bef2329e65775510f38 Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
Date: Mon, 11 Oct 2021 16:24:43 +0530
Subject: [PATCH] telemetry: fix JSON output buffer length
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit b76731683b048337d853cca4fa1530218b82aa40 ]

Earlier, JSON message length was limited to 1024 which would not
allow data more than this size. Removed this limitation by creating
output buffer based on requested data length.

Fixes: 52af6ccb2b39 ("telemetry: add utility functions for creating JSON")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
Acked-by: Ciara Power <ciara.power at intel.com>
---
 lib/librte_telemetry/telemetry_json.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/librte_telemetry/telemetry_json.h b/lib/librte_telemetry/telemetry_json.h
index ad270b9b30..f02a12f5b0 100644
--- a/lib/librte_telemetry/telemetry_json.h
+++ b/lib/librte_telemetry/telemetry_json.h
@@ -9,6 +9,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <rte_common.h>
+#include <rte_telemetry.h>
 
 /**
  * @file
@@ -23,13 +24,13 @@
  * @internal
  * Copies a value into a buffer if the buffer has enough available space.
  * Nothing written to buffer if an overflow ocurs.
- * This function is not for use for values larger than 1k.
+ * This function is not for use for values larger than given buffer length.
  */
 __rte_format_printf(3, 4)
 static inline int
 __json_snprintf(char *buf, const int len, const char *format, ...)
 {
-	char tmp[1024];
+	char tmp[len];
 	va_list ap;
 	int ret;
 
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:07.437541909 +0800
+++ 0123-telemetry-fix-JSON-output-buffer-length.patch	2021-11-10 14:17:01.884079315 +0800
@@ -1 +1 @@
-From b76731683b048337d853cca4fa1530218b82aa40 Mon Sep 17 00:00:00 2001
+From aa4a2ef3fee892f204a04bef2329e65775510f38 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit b76731683b048337d853cca4fa1530218b82aa40 ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -16 +18 @@
- lib/telemetry/telemetry_json.h | 5 +++--
+ lib/librte_telemetry/telemetry_json.h | 5 +++--
@@ -19 +21 @@
-diff --git a/lib/telemetry/telemetry_json.h b/lib/telemetry/telemetry_json.h
+diff --git a/lib/librte_telemetry/telemetry_json.h b/lib/librte_telemetry/telemetry_json.h
@@ -21,2 +23,2 @@
---- a/lib/telemetry/telemetry_json.h
-+++ b/lib/telemetry/telemetry_json.h
+--- a/lib/librte_telemetry/telemetry_json.h
++++ b/lib/librte_telemetry/telemetry_json.h


More information about the stable mailing list