Acked-by: Chengwen Feng <[email protected]>
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 <[email protected]>