[PATCH v2 1/3] usertools/telemetry: add a FOREACH command

fengchengwen fengchengwen at huawei.com
Fri May 29 02:17:56 CEST 2026


Acked-by: Chengwen Feng <fengchengwen at huawei.com>

On 5/22/2026 9:37 PM, Bruce Richardson wrote:
> To simplify querying data from multiple devices, e.g. across ethdevs, or
> dmadevs, add a FOREACH command to the python script, allowing you to
> run, e.g. /ethdev/list, and then run a second command for each item in
> the list, gathering the relevant output values, optionally including an
> index counter.
> 
> Simple examples are given in the documentation:
> 
>   --> FOREACH /ethdev/list /ethdev/stats .opackets
>   [0, 0]
> 
>   --> FOREACH /ethdev/list /ethdev/stats .ipackets .opackets
>   [{"ipackets": 0, "opackets": 0}, {"ipackets": 0, "opackets": 0}]
> 
>   --> FOREACH i /ethdev/list /ethdev/info,$i .name
>   [{"i": 0, "name": "0000:16:00.0"}, {"i": 1, "name": "0000:16:00.1"}]
> 
>   --> FOREACH i /ethdev/list /ethdev/stats,$i .ipackets .opackets
>   [{"i": 0, "ipackets": 0, "opackets": 0}, {"i": 1, "ipackets": 0, "opackets": 0}]
> 
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>



More information about the dev mailing list