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 C61DAA00C2; Thu, 8 Dec 2022 11:55:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7094540E28; Thu, 8 Dec 2022 11:55:18 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id ABDF940DDC for ; Thu, 8 Dec 2022 11:55:17 +0100 (CET) Content-class: urn:content-classes:message Subject: RE: [PATCH 8/8] ethdev: telemetry convert capability related variable to hex MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Thu, 8 Dec 2022 11:55:16 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87573@smartserver.smartshare.dk> In-Reply-To: <20221208080540.62913-9-lihuisong@huawei.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH 8/8] ethdev: telemetry convert capability related variable to hex Thread-Index: AdkK2+iL3SrWpReLR/WfPzgI4AoUFwAFWuQw References: <20221208080540.62913-1-lihuisong@huawei.com> <20221208080540.62913-9-lihuisong@huawei.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Huisong Li" , , , , Cc: , , 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 +To: Bruce and Stephen might also have opinions on this. > From: Huisong Li [mailto:lihuisong@huawei.com] > Sent: Thursday, 8 December 2022 09.06 >=20 > The 'dev_flags', 'rx_offloads', 'tx_offloads' and 'rss_hf' are = suitable > for hexadecimal display. >=20 > Like: > -->old display by input /ethdev/info,0 > "dev_flags": 3, > "rx_offloads": 524288, > "tx_offloads": 65536, > "ethdev_rss_hf": 9100 >=20 > --> now display > "dev_flags": "0x3", > "rx_offloads": "0x80000", > "tx_offloads": "0x10000", > "ethdev_rss_hf": "0x238c" This is certainly good for human consumption, but perhaps not for = machine consumption (where a number type is more appropriate than a = string type). Unfortunately, the JSON format [RFC7159] does not allow hexadecimal = numbers, so hexadecimal values (if supported) have to be passed as = strings. [RFC7159]: https://www.rfc-editor.org/rfc/rfc7159 This leaves us with the key question: Do we want to provide integer values like these as hexadecimal encoded = strings? If we do, then the telemetry library should provide the functions to do = it, rather than doing it here (and everywhere else, where relevant).