Thread (88 messages) 88 messages, 7 authors, 2019-10-21

Re: [dpdk-dev] [EXT] [PATCH v4 1/3] eal/arm64: add 128-bit atomic compare exchange

From: Jerin Jacob Kollanukkaran <hidden>
Date: 2019-07-22 10:20:16

-----Original Message-----
From: Phil Yang <redacted>
Sent: Monday, July 22, 2019 2:14 PM
To: dev@dpdk.org
Cc: thomas@monjalon.net; Jerin Jacob Kollanukkaran <redacted>;
gage.eads@intel.com; hemant.agrawal@nxp.com;
Honnappa.Nagarahalli@arm.com; gavin.hu@arm.com; nd@arm.com
Subject: [EXT] [PATCH v4 1/3] eal/arm64: add 128-bit atomic compare exchange
Add 128-bit atomic compare exchange on aarch64.

Suggested-by: Jerin Jacob <redacted>
Signed-off-by: Phil Yang <redacted>
Tested-by: Honnappa Nagarahalli <redacted>
Reviewed-by: Honnappa Nagarahalli <redacted>
+
+#
+# Compile ARM LSE ATOMIC instructions statically #
There is NO value for the keyword "statically" here. Right?
+CONFIG_RTE_ARM_FEATURE_ATOMICS=n
quoted hunk ↗ jump to hunk
diff --git a/config/defconfig_arm64-thunderx2-linuxapp-gcc
b/config/defconfig_arm64-thunderx2-linuxapp-gcc
index cc5c64b..17b6dec 100644
--- a/config/defconfig_arm64-thunderx2-linuxapp-gcc
+++ b/config/defconfig_arm64-thunderx2-linuxapp-gcc
@@ -6,6 +6,7 @@

 CONFIG_RTE_MACHINE="thunderx2"

+CONFIG_RTE_ARM_FEATURE_ATOMICS=y

Add for octeontx2 as well.
 CONFIG_RTE_CACHE_LINE_SIZE=64
 CONFIG_RTE_MAX_NUMA_NODES=2
 CONFIG_RTE_MAX_LCORE=256
+rte_atomic128_cmp_exchange(rte_int128_t *dst,
+				rte_int128_t *exp,
+				const rte_int128_t *src,
+				unsigned int weak,
+				int success,
+				int failure)
+{
+	/* Always do strong CAS */
+	RTE_SET_USED(weak);
+	/* Ignore memory ordering for failure, memory order for
+	 * success must be stronger or equal
+	 */
+	RTE_SET_USED(failure);
+	/* Find invalid memory order */
+	RTE_ASSERT(success == __ATOMIC_RELAXED
+			|| success == __ATOMIC_ACQUIRE
+			|| success == __ATOMIC_RELEASE
+			|| success == __ATOMIC_ACQ_REL
+			|| success == __ATOMIC_SEQ_CST);
+
+#ifdef __ARM_FEATURE_ATOMICS
Shouldn't it be #if defined(__ARM_FEATURE_ATOMICS) ||  defined(RTE_ARM_FEATURE_ATOMICS) ?


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help