DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] ethdev: document that stats reset APIs are not thread-safe
@ 2024-04-25 16:53 Ferruh Yigit
  2024-04-26 12:20 ` Morten Brørup
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Ferruh Yigit @ 2024-04-25 16:53 UTC (permalink / raw)
  To: Thomas Monjalon, Andrew Rybchenko
  Cc: dev, stable, Mattias Rönnblom, Stephen Hemminger,
	Morten Brørup

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: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
Cc: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Morten Brørup <mb@smartsharesystems.com>

This update triggered by mail list discussion [1].

[1]
https://inbox.dpdk.org/dev/3b2cf48e-2293-4226-b6cd-5f4dd3969f99@lysator.liu.se/
---
 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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-10-04 22:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-25 16:53 [PATCH] ethdev: document that stats reset APIs are not thread-safe Ferruh Yigit
2024-04-26 12:20 ` Morten Brørup
2024-04-26 15:13   ` Stephen Hemminger
2024-04-26 15:17     ` Morten Brørup
2024-04-26 22:57       ` Stephen Hemminger
2024-04-28 15:52       ` Mattias Rönnblom
2024-04-29  6:20         ` Morten Brørup
2024-04-29 15:33           ` Stephen Hemminger
2024-04-28 15:48   ` Mattias Rönnblom
2024-04-29  7:57     ` Morten Brørup
2024-04-29  9:30       ` Mattias Rönnblom
2024-04-26 21:33 ` Patrick Robb
2024-10-04 22:27 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).