[v6] telemetry: remove limitation on JSON output buffer length

Message ID 65d6e703fa474bc6c2396462511a2126dc05e736.1633949496.git.gmuthukrishn@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v6] telemetry: remove limitation on JSON output buffer length |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS

Commit Message

Gowrishankar Muthukrishnan Oct. 11, 2021, 10:54 a.m. UTC
  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@marvell.com>
---
v6:
 - rephrased the commit header and message.
---
 lib/telemetry/telemetry_json.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Comments

Power, Ciara Oct. 13, 2021, 11:06 a.m. UTC | #1
>-----Original Message-----
>From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
>Sent: Monday 11 October 2021 11:55
>To: dev@dpdk.org
>Cc: Richardson, Bruce <bruce.richardson@intel.com>; Power, Ciara
><ciara.power@intel.com>; jerinj@marvell.com; Gowrishankar Muthukrishnan
><gmuthukrishn@marvell.com>
>Subject: [v6] telemetry: remove limitation on JSON output buffer length
>
>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@marvell.com>
>---
<snip>

Thanks,

Acked-by: Ciara Power <ciara.power@intel.com>
  
Thomas Monjalon Oct. 13, 2021, 3:25 p.m. UTC | #2
> >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@marvell.com>
> >---
> <snip>
> 
> Thanks,
> 
> Acked-by: Ciara Power <ciara.power@intel.com>

Applied, thanks.
  

Patch

diff --git a/lib/telemetry/telemetry_json.h b/lib/telemetry/telemetry_json.h
index ad270b9b30..f02a12f5b0 100644
--- a/lib/telemetry/telemetry_json.h
+++ b/lib/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;