DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "David Marchand" <david.marchand@redhat.com>,
	"Tyler Retzlaff" <roretzla@linux.microsoft.com>,
	<thomas@monjalon.net>
Cc: <dev@dpdk.org>, "Qiming Yang" <qiming.yang@intel.com>,
	"Wenjun Wu" <wenjun1.wu@intel.com>
Subject: RE: [PATCH] net/ixgbe: fix inverted test and set conditional
Date: Mon, 19 Jun 2023 10:19:00 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D879E9@smartserver.smartshare.dk> (raw)
In-Reply-To: <CAJFAV8zrV=4LZrmrMeV5987rFVSpYoo+iFAg=6mxBQq1=+o-Mw@mail.gmail.com>

> From: David Marchand [mailto:david.marchand@redhat.com]
> Sent: Monday, 19 June 2023 09.54
> 
> On Thu, Jun 15, 2023 at 9:30 PM Tyler Retzlaff
> <roretzla@linux.microsoft.com> wrote:
> >
> > Correct a mistake when converting ixgbe to use __atomic_test_and_set
> > instead of rte_atomic32_test_and_set. The return value from
> > __atomic_test_and_set is inverted relative to rte_atomic32_test_and_set.
> >
> > Fixes: e90baf6b82f6 ("net/ixgbe: replace legacy atomics with GCC builtin
> atomics")
> >
> > Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> Reviewed-by: David Marchand <david.marchand@redhat.com>
> 
> Thanks for the fix Tyler.

rte_atomic32_test_and_set() returns the inverse of __atomic_test_and_set()!

We need to provide a prominent warning about this when deprecating rte_atomic32_test_and_set(), or everyone else will make the same mistake as Tyler, i.e. perform a simple search/replace with the new function name, not noticing that the function's return value is inverted.
Perhaps we can also add some build time warning when using rte_atomic32_test_and_set()?

PS:
Tyler, the Solarflare driver also uses rte_atomic32_test_and_set(); maybe you missed in the original patch series.
https://elixir.bootlin.com/dpdk/v23.07-rc1/A/ident/rte_atomic32_test_and_set


  reply	other threads:[~2023-06-19  8:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 19:30 Tyler Retzlaff
2023-06-15 19:30 ` Tyler Retzlaff
2023-06-16  1:59   ` Chen, LingliX
2023-06-19  7:53   ` David Marchand
2023-06-19  8:19     ` Morten Brørup [this message]
2023-06-19 16:27       ` Tyler Retzlaff

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=98CBD80474FA8B44BF855DF32C47DC35D879E9@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=qiming.yang@intel.com \
    --cc=roretzla@linux.microsoft.com \
    --cc=thomas@monjalon.net \
    --cc=wenjun1.wu@intel.com \
    /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).