> From: David Marchand [mailto:[email protected]] > Sent: Monday, 19 June 2023 09.54 > > On Thu, Jun 15, 2023 at 9:30 PM Tyler Retzlaff > <[email protected]> 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 <[email protected]> > Reviewed-by: David Marchand <[email protected]> > > 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

