On 12 Aug 2026, at 15:07, Timothy Redaelli wrote:

> When --format json is passed to ovs-appctl, pmd-sleep-show returns a
> JSON object with "default-max-sleep-us" and a "threads" object.  Each
> thread is keyed by a stable identifier ("pmd-cNN" derived from the core
> ID) and contains "core", "max-sleep-us", and "numa" fields.
>
> The "pmd-cNN" key format is chosen over the full thread name
> ("pmd-cNN/id:XXX") because the thread ID suffix is dynamic and would
> make the key unstable across restarts.
>
> The implementation is split into separate text and JSON helper functions.
>
> Example output:
>   {"default-max-sleep-us": 100,
>    "threads": {"pmd-c03": {"core": 3, "max-sleep-us": 100,
>                             "numa": 1}}}
>
> Signed-off-by: Timothy Redaelli <[email protected]>

Thanks for the new revision, Timothy, two small nits below.

//Eelco

[...]

>      sorted_poll_thread_list(dp, &pmd_list, &n);
> +
> +    if (type == PMD_INFO_SLEEP_SHOW
> +        && unixctl_command_get_output_format(conn)
> +               == UNIXCTL_OUTPUT_FMT_JSON) {
> +        struct json *json_result = pmd_info_sleep_show_json(dp, pmd_list, n);

New line here.

> +        free(pmd_list);
> +        ovs_mutex_unlock(&dp_netdev_mutex);

I would swap the two lines above, i.e., do the free outside of the lock.

> +        unixctl_command_reply_json(conn, json_result);
> +        return;
> +    }
> +

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to