eal: fix msvc conditional compile of rte atomic thread fence

Message ID 1699387216-21396-1-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series eal: fix msvc conditional compile of rte atomic thread fence |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS

Commit Message

Tyler Retzlaff Nov. 7, 2023, 8 p.m. UTC
  MSVC does not expose legacy atomics. When the legacy atomics were
excluded rte_atomic_thread_fence was also unintentionally excluded

Adjust the conditional compilation check to expose
rte_atomic_thread_fence.

Fixes: 27da6a123414 ("eal: hide legacy atomics API for MSVC")

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/eal/x86/include/rte_atomic.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Morten Brørup Nov. 8, 2023, 8:27 a.m. UTC | #1
> From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com]
> Sent: Tuesday, 7 November 2023 21.00
> 
> MSVC does not expose legacy atomics. When the legacy atomics were
> excluded rte_atomic_thread_fence was also unintentionally excluded
> 
> Adjust the conditional compilation check to expose
> rte_atomic_thread_fence.
> 
> Fixes: 27da6a123414 ("eal: hide legacy atomics API for MSVC")
> 
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> ---

Acked-by: Morten Brørup <mb@smartsharesystems.com>
  
Thomas Monjalon Nov. 8, 2023, 1:40 p.m. UTC | #2
08/11/2023 09:27, Morten Brørup:
> > From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com]
> > Sent: Tuesday, 7 November 2023 21.00
> > 
> > MSVC does not expose legacy atomics. When the legacy atomics were
> > excluded rte_atomic_thread_fence was also unintentionally excluded
> > 
> > Adjust the conditional compilation check to expose
> > rte_atomic_thread_fence.
> > 
> > Fixes: 27da6a123414 ("eal: hide legacy atomics API for MSVC")
> > 
> > Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> 
> Acked-by: Morten Brørup <mb@smartsharesystems.com>

Applied, thanks.
  

Patch

diff --git a/lib/eal/x86/include/rte_atomic.h b/lib/eal/x86/include/rte_atomic.h
index f754423..74b1b24 100644
--- a/lib/eal/x86/include/rte_atomic.h
+++ b/lib/eal/x86/include/rte_atomic.h
@@ -83,8 +83,6 @@ 
 
 #define rte_io_rmb() rte_compiler_barrier()
 
-#ifndef RTE_TOOLCHAIN_MSVC
-
 /**
  * Synchronization fence between threads based on the specified memory order.
  *
@@ -101,6 +99,8 @@ 
 		__rte_atomic_thread_fence(memorder);
 }
 
+#ifndef RTE_TOOLCHAIN_MSVC
+
 /*------------------------- 16 bit atomic operations -------------------------*/
 
 #ifndef RTE_FORCE_INTRINSICS