+To: Bruce and Stephen might also have opinions on this.

> From: Huisong Li [mailto:lihuis...@huawei.com]
> Sent: Thursday, 8 December 2022 09.06
> 
> The 'dev_flags', 'rx_offloads', 'tx_offloads' and 'rss_hf' are suitable
> for hexadecimal display.
> 
> Like:
>  -->old display by input /ethdev/info,0
>       "dev_flags": 3,
>       "rx_offloads": 524288,
>       "tx_offloads": 65536,
>       "ethdev_rss_hf": 9100
> 
>  --> 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).

Reply via email to