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 9087A4627A; Fri, 21 Feb 2025 20:53:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4AA80427B6; Fri, 21 Feb 2025 20:53:05 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 5DFEA4279F for ; Fri, 21 Feb 2025 20:52:50 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id 05FC320545AC; Fri, 21 Feb 2025 11:52:48 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 05FC320545AC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1740167569; bh=PsSMNxEbBL72UOOEw++hrubZMXFY61LfRPUKe733GQ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rqYpalziIiIiac4JGHcYNrAAmU/Qs24uyfDIxB6mVx5jVKkjb+Pf9KsYdVZ6a/dlu Cv2X1CI51IGTVVm8qS9Rz4qAa61UZ4ytHuX3LXYMX6J8a1iH7SHgLTRbv+xtteR6RV HIBzm/EWfZsWZsxbCwHQ4QURTQnQ1enlF07/UZdI= From: Andre Muezerie To: andremue@linux.microsoft.com Cc: dev@dpdk.org, Chengwen Feng Subject: [PATCH v5 08/10] test-pmd: declare lcore_count atomic Date: Fri, 21 Feb 2025 11:52:41 -0800 Message-Id: <1740167563-12332-9-git-send-email-andremue@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1740167563-12332-1-git-send-email-andremue@linux.microsoft.com> References: <1739311325-14425-1-git-send-email-andremue@linux.microsoft.com> <1740167563-12332-1-git-send-email-andremue@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 Compiling with MSVC results in the error below: app/test/test_ring_perf.c(197): error C7712: address argument to atomic operation must be a pointer to an atomic integer, 'volatile unsigned int *' is not valid The fix is to mark lcore_count as atomic. Signed-off-by: Andre Muezerie Signed-off-by: Chengwen Feng --- app/test/test_ring_perf.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c index 57cd04a124..921aa902c5 100644 --- a/app/test/test_ring_perf.c +++ b/app/test/test_ring_perf.c @@ -34,7 +34,7 @@ struct lcore_pair { unsigned c1, c2; }; -static volatile unsigned lcore_count = 0; +static volatile RTE_ATOMIC(unsigned int) lcore_count; static void test_ring_print_test_string(unsigned int api_type, int esize, @@ -193,11 +193,7 @@ enqueue_dequeue_bulk_helper(const unsigned int flag, struct thread_params *p) unsigned int n_remaining; const unsigned int bulk_n = bulk_sizes[p->ring_params->bulk_sizes_i]; -#ifdef RTE_USE_C11_MEM_MODEL if (rte_atomic_fetch_add_explicit(&lcore_count, 1, rte_memory_order_relaxed) + 1 != 2) -#else - if (__sync_add_and_fetch(&lcore_count, 1) != 2) -#endif while(lcore_count != 2) rte_pause(); -- 2.48.1.vfs.0.0