On Mon, Apr 1, 2024 at 10:37 PM Robin Jarry <[email protected]> wrote:
>
> In rte_graph_cluster_stats_get, the walk model of the first graph is
> checked to determine if multi-core dispatch specific counters should be
> updated or not. This global list is accessed without any locks.
>
> If the global list is modified by another thread while
> rte_graph_cluster_stats_get is called, it can result in undefined
> behaviour.
>
> Adding a lock would make it impossible to call
> rte_graph_cluster_stats_get in packet processing code paths. Avoid
> accessing the global list instead by storing a bool field in the private
> rte_graph_cluster_stats structure.
>
> Also update the default callback to avoid accessing the global list and
> use a different default callback depending on the graph model.
Fixes: 358ff83fe88c ("graph: add stats for mcore dispatch model")
Cc: [email protected]
>
> Signed-off-by: Robin Jarry <[email protected]>
Acked-by: Kiran Kumar Kokkilagadda <[email protected]>
Applied, thanks.
This may be worth a unit test, though I don't think it is trivial.
--
David Marchand