Making 'rte_eth_stats_reset()' and 'rte_eth_xstats_reset()' APIs thread safe has performance impact on datapath.
Instead document APIs as not thread safe and add condition for reliable stats reset functionality, forwarding should be stopped. Cc: [email protected] Signed-off-by: Ferruh Yigit <[email protected]> --- Cc: Mattias Rönnblom <[email protected]> Cc: Stephen Hemminger <[email protected]> Cc: Morten Brørup <[email protected]> This update triggered by mail list discussion [1]. [1] https://inbox.dpdk.org/dev/[email protected]/ --- lib/ethdev/rte_ethdev.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index 548fada1c7ad..40f04c0e191b 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -3136,6 +3136,9 @@ int rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats); /** * Reset the general I/O statistics of an Ethernet device. * + * API is not multi-thread safe. + * Application should stop forwarding before calling this API. + * * @param port_id * The port identifier of the Ethernet device. * @return @@ -3296,6 +3299,9 @@ int rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, /** * Reset extended statistics of an Ethernet device. * + * API is not multi-thread safe. + * Application should stop forwarding before calling this API. + * * @param port_id * The port identifier of the Ethernet device. * @return -- 2.34.1

