DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
To: dev@dpdk.org
Cc: Qiming Yang <qiming.yang@intel.com>,
	Wenjun Wu <wenjun1.wu@intel.com>,
	mb@smartsharesystems.com,
	Tyler Retzlaff <roretzla@linux.microsoft.com>,
	david.marchand@redhat.com
Subject: [PATCH] net/ixgbe: fix inverted test and set conditional
Date: Thu, 15 Jun 2023 12:30:02 -0700	[thread overview]
Message-ID: <1686857402-29916-2-git-send-email-roretzla@linux.microsoft.com> (raw)
In-Reply-To: <1686857402-29916-1-git-send-email-roretzla@linux.microsoft.com>

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")
Cc: roretzla@linux.microsoft.com
Cc: david.marchand@redhat.com
Cc: qiming.yang@intel.com

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 43aea2e..5f73ae8 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4322,7 +4322,7 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 		if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) {
 			ixgbe_dev_wait_setup_link_complete(dev, 0);
 			/* NOTE: review for potential ordering optimization */
-			if (__atomic_test_and_set(&ad->link_thread_running, __ATOMIC_SEQ_CST)) {
+			if (!__atomic_test_and_set(&ad->link_thread_running, __ATOMIC_SEQ_CST)) {
 				/* To avoid race condition between threads, set
 				 * the IXGBE_FLAG_NEED_LINK_CONFIG flag only
 				 * when there is no link thread running.
-- 
1.8.3.1


  reply	other threads:[~2023-06-15 19:30 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 [this message]
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

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=1686857402-29916-2-git-send-email-roretzla@linux.microsoft.com \
    --to=roretzla@linux.microsoft.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    --cc=qiming.yang@intel.com \
    --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).