> From: Chengwen Feng [mailto:[email protected]]
> Sent: Wednesday, 20 May 2026 11.38
> 
> Add /ethdev/list_names telemetry endpoint which returns a dictionary
> keyed by port ID with device name as the value, so users can
> identify ports by name directly from the telemetry output.
> 
> Original /ethdev/list output:
>   {"/ethdev/list": [0, 1]}
> 
> New /ethdev/list_names output:
>   {"/ethdev/list_names": {"0": "0000:7d:00.0",
>   "1": "0000:7d:00.1"}}
> 

<rant>

Unfortunately, the telemetry protocol in DPDK is not using a common design, but 
takes parameters specific to each path.
It should have used OData or something similar, to standardize listing, 
filtering, etc.
Then we could have queried this like:
/ethdev/info?$select=port_id,name
And return something like:
[
        {
                "port_id": 0,
                "name": "0000:7d:00.0"
        },
        {
                "port_id": 1,
                "name": "0000:7d:00.1"
        }
]
or:
[
        {
                0,
                "0000:7d:00.0"
        },
        {
                1,
                "0000:7d:00.1"
        }
]

But now we are stuck with what we have.

</rant>

So /etdev/list_names is OK.

I'm not really familiar with the DPDK telemetry, so I wonder if indexed arrays 
are normally returned as an object, like in this patch?

I would have expected a list function (such as list_names) to return an array.
Either a simple list:
{
        "/ethdev/list_names":
        [
                "0000:7d:00.0",
                "0000:7d:00.1"
        ]
}

Or a list of objects:
{
        "/ethdev/list_names":
        [
                {
                        "port_id": 0,
                        "name": "0000:7d:00.0"
                },
                {
                        "port_id": 1,
                        "name": "0000:7d:00.1"
                }
        ]
}

Reply via email to