Fix cmpexchange usage of weak / strong.
The generated code is the same on x86 and ARM (there is no weak
cmpexchange), but the old usage was inconsistent.
For push and pop update size, weak is used because cmpexchange is inside
a loop.
For pop update root, strong is used even though cmpexchange is inside a
loop, because there may be a lot of operations to do in a loop iteration
(locate the new head).
Signed-off-by: Steven Lariau <steven.lariau@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Gage Eads <gage.eads@intel.com>
/* len is updated on failure */
if (__atomic_compare_exchange_n(&list->len,
&len, len - num,
- 0, __ATOMIC_ACQUIRE,
+ 1, __ATOMIC_ACQUIRE,
__ATOMIC_ACQUIRE))
break;
}
(rte_int128_t *)&list->head,
(rte_int128_t *)&old_head,
(rte_int128_t *)&new_head,
- 1, __ATOMIC_RELEASE,
+ 0, __ATOMIC_RELEASE,
__ATOMIC_RELAXED);
} while (success == 0);