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 64A7E45F3D; Wed, 25 Dec 2024 12:33:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE88D402F2; Wed, 25 Dec 2024 12:33:54 +0100 (CET) Received: from smtpbgeu1.qq.com (smtpbgeu1.qq.com [52.59.177.22]) by mails.dpdk.org (Postfix) with ESMTP id 77F28402EA for ; Wed, 25 Dec 2024 12:33:52 +0100 (CET) X-QQ-mid: Yeas4t1735126427t081t16385 Received: from 0F57A7141CBF4D1588B97A6ED8A17143 (zaiyuwang@trustnetic.com [36.24.116.64]) X-QQ-SSF: 0000000000000000000000000000000 From: =?utf-8?b?WmFpeXUgV2FuZw==?= X-BIZMAIL-ID: 12040025344354991073 To: "'Jiawen Wu'" , "'Stephen Hemminger'" , References: <20241008160209.68000-1-stephen@networkplumber.org> <20241008160209.68000-3-stephen@networkplumber.org> <20241204141903.2a2c3f2d@hermes.local> <01b101db56aa$4b807360$e2815a20$@trustnetic.com> In-Reply-To: <01b101db56aa$4b807360$e2815a20$@trustnetic.com> Subject: RE: [RFC 2/5] net/ngbe: fix query handling in xstats_get Date: Wed, 25 Dec 2024 19:33:45 +0800 Message-ID: <001201db56c0$dc0164b0$94042e10$@trustnetic.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQCLo9EvFT+q4cuMUxIvDnsNk0zWFQGlvsMfAdQLgwUB5LiLm7VrO9OA Content-Language: zh-cn X-QQ-SENDSIZE: 520 Feedback-ID: Yeas:trustnetic.com:qybglogicsvrgz:qybglogicsvrgz5a-1 X-QQ-XMAILINFO: ND42uzdxTIzrhHIr530KoC3SNmaCApkW2znFGcOOyvtCkO+98uWCufyj C/f6MA2grBE6RW1IX5Gzv9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DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > > Cc: Zaiyu Wang > > > -----Original Message----- > > From: Stephen Hemminger > > Sent: Thursday, December 5, 2024 6:19 AM > > To: dev@dpdk.org > > Cc: jiawenwu@trustnetic.com > > Subject: Re: [RFC 2/5] net/ngbe: fix query handling in xstats_get > > > > On Tue, 8 Oct 2024 08:59:56 -0700 > > Stephen Hemminger wrote: > > > > > The xstats_get function in this driver did not act the same as other > > > drivers when queried. The correct check is to look at the requested > > > number of stats and compare it to the available stats and if the > > > request is too small, return the correct size. > > > > > > Bugzilla ID: 1560 > > > Fixes: 8b433d04adc9 ("net/ngbe: support device xstats") > > > Cc: jiawenwu@trustnetic.com > > > > > > Signed-off-by: Stephen Hemminger > > > > This needs to be tested on this hardware before merging. > > > Hi Stephen Hemminger, We have tested this patch for ngbe&txgbe driver with the corresponding hardware. But this patch can't fix the bug reported in Bugzilla. In fact, most applications, including telemetry, call rte_eth_xstats_get twice, fist to get num of xstats and then to get the full xstats data. This bug appeared after dpdk-22.11 because rte_tel_data_add_dict_string restricted the characters in dicts, and '[' and ']' were no longer allowed to be used, so ngbe&txgbe could not print xstats by telemetry. For more details about this restriction, please see: https://patches.dpdk.org/project/dpdk/patch/20220909093523.471727-2-bruce.ri chardson@intel.com/ And here is the code in ngbe for setting xstats name, which add '[' and ']' in them: static inline int ngbe_get_name_by_id(uint32_t id, char *name, uint32_t size) { ... if (id < NGBE_NB_HW_STATS) { snprintf(name, size, "[hw]%s", rte_ngbe_stats_strings[id].name); return 0; } To save this issue, could we add '[' and ']' to the allowed characters of telemetry? Or we must change the xstats name in ngbe&txgbe driver? Thanks.