patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Ferruh Yigit <ferruh.yigit@amd.com>
Cc: "Thomas Monjalon" <thomas@monjalon.net>,
	"Andrew Rybchenko" <andrew.rybchenko@oktetlabs.ru>,
	dev@dpdk.org, stable@dpdk.org,
	"Mattias Rönnblom" <mattias.ronnblom@ericsson.com>,
	"Morten Brørup" <mb@smartsharesystems.com>
Subject: Re: [PATCH] ethdev: document that stats reset APIs are not thread-safe
Date: Fri, 4 Oct 2024 15:27:54 -0700	[thread overview]
Message-ID: <20241004152754.10e35605@hermes.local> (raw)
In-Reply-To: <20240425165308.1078454-1-ferruh.yigit@amd.com>

On Thu, 25 Apr 2024 17:53:08 +0100
Ferruh Yigit <ferruh.yigit@amd.com> wrote:

> 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

Putting a note in the documentation is good, but it would be better to
be more explicit about what happens if used unsafely.

Something like adding a not to stats_reset like.

* Resetting the statistics while device is active is not an atomic operation;
* doing a reset while forwarding may lead to inconsistent counter values.


      parent reply	other threads:[~2024-10-04 22:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-25 16:53 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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241004152754.10e35605@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=mattias.ronnblom@ericsson.com \
    --cc=mb@smartsharesystems.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).