From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A970F42CC9; Thu, 15 Jun 2023 21:30:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 292AE41104; Thu, 15 Jun 2023 21:30:15 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 99577410D0 for ; Thu, 15 Jun 2023 21:30:13 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id A363920FEA3E; Thu, 15 Jun 2023 12:30:12 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A363920FEA3E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1686857412; bh=9UXW2kuIug7Cpgf5hV2A5wW9Xvcygjf4PcecDIcpWoU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QNSCsJ8KHV0Hon1bPjqIAhOxcUdeFyPbNgt+fGI1KHDhldxbb27TqbBekOrQIHoOw 7V/nNzOaZIj2B0VQV3MWEN69UQYQ2rfYTG5h1LpuCHMybwUwgoG3XJQiDu9lCT1uDd Rtpe4qwH+76kgy9g386IenF6opF+lbppf4vD0adA= From: Tyler Retzlaff To: dev@dpdk.org Cc: Qiming Yang , Wenjun Wu , mb@smartsharesystems.com, Tyler Retzlaff , david.marchand@redhat.com Subject: [PATCH] net/ixgbe: fix inverted test and set conditional Date: Thu, 15 Jun 2023 12:30:02 -0700 Message-Id: <1686857402-29916-2-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1686857402-29916-1-git-send-email-roretzla@linux.microsoft.com> References: <1686857402-29916-1-git-send-email-roretzla@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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