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 9E2354625E; Tue, 18 Feb 2025 17:32:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39725406A2; Tue, 18 Feb 2025 17:32:25 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 2736F40658 for ; Tue, 18 Feb 2025 17:32:16 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id A146520376EE; Tue, 18 Feb 2025 08:32:14 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A146520376EE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1739896334; bh=i+VwVkbdcjw5oZ6WP4cCGkYkY/ToiACDQEGhH/Sy6lc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hywm8NRWC5lB2D7UfX4NoWwQWvEn5PLe0sWIlvkMhmy/O3meKFyDMIYEAgaJF1V1e 952QUCQ7kzXWDZe967atkU+XzjN2oyrKEqS2mgD5jZF3CVaz6w/JB2Qv3t1GYu34Dx Cvf1Spx9XgdUP5WuM/TFqWQLlxtnCBUaLY7TCjiU= From: Andre Muezerie To: andremue@linux.microsoft.com Cc: dev@dpdk.org, Chengwen Feng Subject: [PATCH v2 08/10] test-pmd: declare lcore_count atomic Date: Tue, 18 Feb 2025 08:32:07 -0800 Message-Id: <1739896329-1946-9-git-send-email-andremue@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1739896329-1946-1-git-send-email-andremue@linux.microsoft.com> References: <1739311325-14425-1-git-send-email-andremue@linux.microsoft.com> <1739896329-1946-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..366e256323 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 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