On Wed, May 20, 2026 at 03:31:57PM +0800, fengchengwen wrote: > On 5/20/2026 1:40 PM, Morten Brørup wrote: > >> From: Chengwen Feng [mailto:[email protected]] > >> Sent: Wednesday, 20 May 2026 05.57 > >> > >> Currently, the /dmadev/list and /ethdev/list telemetry endpoints return > >> only integer IDs, making it hard to identify devices. This series > >> changes > >> both to output strings in "ID NAME" format for better usability. > > > > For machine reading of the JSON output, it would be better returning an > > object with an integer and a string field, {ID, "NAME"}. > > The TEL_DICT could do {"ID", "NAME"}, which like: > "/ethdev/list": { > "0": "0000:7d:00.0", > "1": "0000:7d:00.1" > } > > Maybe we could add one TEL_INT_DICT which is int-value pairs, we may get: > "/ethdev/list": { > 0: "0000:7d:00.0", > 1: "0000:7d:00.1" > } > > I prefer the first one, However, the capacity is reduced from 512 > (RTE_TEL_MAX_ARRAY_ENTRIES) to 256 (RTE_TEL_MAX_DICT_ENTRIES), but I think it > is enough. > > What's your opinion? >
I'm not sure about this change at all. This change is only relevant for those using the script interactively, for any other use, I would expect the the /ethdev/list call would be followed by the /ethdev/info calls for each port to get the name. That was the basic design in mind for this, the list call was purely to provide the ids, any other info you make separate calls for. Also, while not officially part of the ABI of DPDK, I think it would be wrong to go changing the types of the returned data from this /ethdev/list call. Any user-written interfaces to telemetry will be relying on the current behaviour to list and query ports. If you really want to have an easy way to get the names of the ports, I suggest adding instead an "/ethdev/list_names" API, which can either return the objects above, or else simply an array of names. /Bruce

