DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
To: "Morten Brørup" <mb@smartsharesystems.com>
Cc: David Marchand <david.marchand@redhat.com>,
	thomas@monjalon.net, 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 09:27:44 -0700	[thread overview]
Message-ID: <20230619162744.GA18752@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> (raw)
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D879E9@smartserver.smartshare.dk>

On Mon, Jun 19, 2023 at 10:19:00AM +0200, Morten Brørup wrote:
> > 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()?

i'll probably take care of this work myself after stdatomics (assuming
it is something people want) and hopefully i won't make that mistake
again. for now i don't want to confuse the dev list with too many
patches about 'atomics' to avoid overload/confusion for david and thomas.

> 
> PS:
> Tyler, the Solarflare driver also uses rte_atomic32_test_and_set(); maybe you missed in the original patch series.

it was intentionally skipped (for now). i only did the conversion for
drivers that are built on windows. the assumption being the rte_atomicXX
api deprecation is independent of switching to C11 stdatomic.

i don't intend to ever make available rte_atomicXX on msvc/windows
combination since it is being deprecated. as mentioned above as i expand
the code that is built for msvc/windows it will then force me to adapt
more of the rte_atomicsXX code eventually leading to most of it being
gone (at least for libraries).

> https://elixir.bootlin.com/dpdk/v23.07-rc1/A/ident/rte_atomic32_test_and_set
> 

      reply	other threads:[~2023-06-19 16:27 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
2023-06-19 16:27       ` Tyler Retzlaff [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=20230619162744.GA18752@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net \
    --to=roretzla@linux.microsoft.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    --cc=qiming.yang@intel.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).