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 2813FA0C4D; Thu, 7 Oct 2021 09:22:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AC6284067A; Thu, 7 Oct 2021 09:22:13 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id AB78540140 for ; Thu, 7 Oct 2021 09:22:11 +0200 (CEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 472235C0117; Thu, 7 Oct 2021 03:22:09 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 07 Oct 2021 03:22:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= pmzD5ORU2BkfQXU1d06uBgDNCvOiUNLo4IP0AK4L9e0=; b=DdtJ4k1lCunVRdBG RR5S/RwhOv08WH4ycf4MwfIdYtslXhmXo6njcakA9ysglHpItSGuQNvcqE4r2rdv 6/V6ePpVxfI076W2ldvKGlVHMFNXXWno1ge8bLEG4Of8BzCZQi3guGfSlG5KqeWc L+SPGl5QkZAkbRCfK/MApT1DiB85WH52YT2nXk7/ti2gKgNfqS+LTYKG9sKylj88 AISM7Rlmz4M6lUDAYSWbqi2/D3foKWLy4XUdcHHYiaEYUhuCnvnQiMX/83N+sAg2 SVPonbcMf14Jm+UwbiUHhjoMuDnlkx67HCuh3VJ/Rx+2s9BNkVTERs7+AD4H7IT7 0Xjn5Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=pmzD5ORU2BkfQXU1d06uBgDNCvOiUNLo4IP0AK4L9 e0=; b=SVNyaRGZ8qtm2acae26O44YTfMccofYf6yvPW07GHeM8GIugeUYZLbrCi lnXQF4lfM+uh4T1zZtWqP1oXwvKGrF0VoSigA1e982/0blVA2a9qMUPU75Lmc4fM Y+ygu8Gyrj1lz5SsEuzG+9zdt23ok7I7aPm3Iq+kmxs8KdjON+vNFe1Xm6ZF6RgK b93ocpBbVi1hFcQg51nyikaJtefYMYUFV6gE1ZpDyjefifoFjuGtOd6hxqB/b6XK s2pRtWZolKGwmnBHLPbQE0CIX9BcwEdnI7/AqMp9gLBtT6Ym7X8oE/zan7WzCAbY UNgPNS0mAkZuA9vHZbqExKPfzX2wg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudeljedgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdej ueeiiedvffegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 7 Oct 2021 03:22:07 -0400 (EDT) From: Thomas Monjalon To: Gowrishankar Muthukrishnan Cc: "dev@dpdk.org" , "bruce.richardson@intel.com" , "ciara.power@intel.com" , Jerin Jacob Kollanukkaran Date: Thu, 07 Oct 2021 09:22:03 +0200 Message-ID: <3282535.ZEjqJjJu7l@thomas> In-Reply-To: References: <20210923062619.2285556-1-gmuthukrishn@marvell.com> <2034000.CuE5oqSghi@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [EXT] Re: [v5] telemetry: fix json output buffer size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 07/10/2021 06:58, Gowrishankar Muthukrishnan: > From: Thomas Monjalon > > 29/09/2021 06:18, Gowrishankar Muthukrishnan: > > > Fix json output buffer size for an actual data length. > > > > > > Fixes: 52af6ccb2b39 ("telemetry: add utility functions for creating > > > JSON") > > > > Please could you give a bit more explanations? > > What was not working and why? > > Without this patch, our driver end point (crypto/cnxk) could not successfully deliver the requested info > due to its larger amount than the fixed buffer length of 1024 bytes as handled by __json_snprintf. > I think it is genuine bug too which we caught up here. So the commit log should say the JSON message was limited to 1024, and now you allow any specified length. > > [...] > > > - * 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;