[v2,10/16] net/octeontx: use previous value atomic fetch operations
Checks
Commit Message
Use __atomic_fetch_{add,and,or,sub,xor} instead of
__atomic_{add,and,or,sub,xor}_fetch adding the necessary code to
allow consumption of the resulting value.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
drivers/net/octeontx/octeontx_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -559,7 +559,7 @@ enum octeontx_link_speed {
return 0;
/* Stopping/closing event device once all eth ports are closed. */
- if (__atomic_sub_fetch(&evdev_refcnt, 1, __ATOMIC_ACQUIRE) == 0) {
+ if (__atomic_fetch_sub(&evdev_refcnt, 1, __ATOMIC_ACQUIRE) - 1 == 0) {
rte_event_dev_stop(nic->evdev);
rte_event_dev_close(nic->evdev);
}