common/cnxk: use atomic load acquire in batch ops
PATCH 1/1 common/cnxk: use atomic load acquire in batch ops
In roc batch alloc wait code, __ATOMIC_RELAXED is changed to __ATOMIC_ACQUIRE in order to avoid potential out of order loads.
--- .mailmap | 1 + drivers/common/cnxk/roc_npa.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
.mailmap +1 -0
@@ -1046,6 +1046,7 @@ Natanael Copa <[email protected]> Nathan Brown <[email protected]> Nathan Law <[email protected]> Nathan Skrzypczak <[email protected]> +Nawal Kishor <[email protected]> Neel Patel <[email protected]> <[email protected]> Neil Horman <[email protected]> Nelio Laranjeiro <[email protected]>
drivers/common/cnxk/roc_npa.h +1 -1
@@ -247,7 +247,7 @@ roc_npa_batch_alloc_wait(uint64_t *cache_line, unsigned int wait_us)/* Batch alloc status code is updated in bits [5:6] of the first word * of the 128 byte cache line. */ -while (((__atomic_load_n (cache_line, __ATOMIC_RELAXED) >>5 ) &0x3 ) == +while (((__atomic_load_n (cache_line, __ATOMIC_ACQUIRE) >>5 ) &0x3 ) ==ALLOC_CCODE_INVAL )if (wait_us && (plt_tsc_cycles () - start) >= ticks)break ;
--
2.34.1
Quoted 5 lines · Nawal Kishor
In roc batch alloc wait code,
__ATOMIC_RELAXEDis changed to__ATOMIC_ACQUIREin order to avoid potential out of order loads.Signed-off-by Nawal Kishor <[email protected]>
Could you add Fixes:
And change subject to common/cnxk: fix ...
PATCH v2 1/1 common/cnxk: fix atomic load in batch ops
In reply to Nawal KishorIn roc batch alloc wait code, __ATOMIC_RELAXED is changed to __ATOMIC_ACQUIRE in order to avoid potential out of order loads.
---
v2: Fixed review comments
drivers/common/cnxk/roc_npa.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/common/cnxk/roc_npa.h +1 -1
@@ -255,7 +255,7 @@ roc_npa_batch_alloc_wait(uint64_t *cache_line, unsigned int wait_us)/* Batch alloc status code is updated in bits [5:6] of the first word * of the 128 byte cache line. */ -while (((__atomic_load_n (cache_line, __ATOMIC_RELAXED) >>5 ) &0x3 ) == +while (((__atomic_load_n (cache_line, __ATOMIC_ACQUIRE) >>5 ) &0x3 ) ==ALLOC_CCODE_INVAL )if (wait_us && (plt_tsc_cycles () - start) >= ticks)break ;
Signature · 1 line
2.34.1
RE: [PATCH v2] common/cnxk: fix atomic load in batch ops
Quoted 13 lines
-----Original Message-----
From: Nawal Kishor <[email protected]>
Sent: Monday, December 2, 2024 10:28 PM
To: [email protected]; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Harman Kalra <[email protected]>; Ashwin Sekhar T K <[email protected]>; Jerin Jacob <[email protected]>
Cc: Nawal Kishor <[email protected]>
Subject: [PATCH v2] common/cnxk: fix atomic load in batch ops
Quoted 6 lines
In roc batch alloc wait code,
__ATOMIC_RELAXEDis changed to__ATOMIC_ACQUIREin order to avoid potential out of order loads.Fixes 50d08d3934ec ("common/cnxk: fix batch alloc completion poll logic")Signed-off-by Nawal Kishor <[email protected]>
Fixed the following issues and applied to dpdk-next-net-mrvl/for-main. Thanks
Is it candidate for Cc: [email protected] backport?
common/cnxk: fix atomic load in batch ops
Contributor name/email mismatch with .mailmap:
Nawal Kishor <[email protected]> is unknown in .mailmap
Quoted 24 lines
---
v2: Fixed review commentsdrivers/common/cnxk/roc_npa.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/common/cnxk/roc_npa.h +0
-1@@ -255,7 +255,7 @@ roc_npa_batch_alloc_wait(uint64_t *cache_line, unsigned int wait_us)/* Batch alloc status code is updated in bits [5:6] of the first word * of the 128 byte cache line. */ - while (((__atomic_load_n(cache_line, __ATOMIC_RELAXED) >> 5) &
0x3) ==drivers/common/cnxk/roc_npa.h +1
-0+ while (((__atomic_load_n(cache_line, __ATOMIC_ACQUIRE) >> 5) &
0x3) ==drivers/common/cnxk/roc_npa.h +0
-1ALLOC_CCODE_INVAL)if (wait_us && (plt_tsc_cycles () - start) >= ticks)break ; --2.34.1
RE: [PATCH v2] common/cnxk: fix atomic load in batch ops
Yes. It is a candidate for backport.
Thanks
Ashwin
Quoted 66 lines
-----Original Message-----
From: Jerin Jacob <[email protected]>
Sent: Wednesday, January 22, 2025 10:31 PM
To: Nawal Kishor <[email protected]>; [email protected]; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Harman Kalra <[email protected]>; Ashwin Sekhar T K <[email protected]>
Cc: Nawal Kishor <[email protected]>
Subject: RE: [PATCH v2] common/cnxk: fix atomic load in batch opsQuoted 11 lines
-----Original Message-----
From: Nawal Kishor <[email protected]>
Sent: Monday, December 2, 2024 10:28 PM
To: [email protected]; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Harman Kalra <[email protected]>; Ashwin Sekhar T K <[email protected]>; Jerin Jacob <[email protected]>
Cc: Nawal Kishor <[email protected]>
Subject: [PATCH v2] common/cnxk: fix atomic load in batch opsQuoted 7 lines
In roc batch alloc wait code,
__ATOMIC_RELAXEDis changed to__ATOMIC_ACQUIREin order to avoid potential out of order loads.Fixes 50d08d3934ec ("common/cnxk: fix batch alloc completion polllogic")
Signed-off-by Nawal Kishor <[email protected]>Fixed the following issues and applied to dpdk-next-net-mrvl/for-main. Thanks
Is it candidate for Cc: [email protected] backport?
common/cnxk: fix atomic load in batch ops Contributor name/email
mismatch with .mailmap:
Nawal Kishor <[email protected]> is unknown in .mailmapQuoted 8 lines
---
v2: Fixed review commentsdrivers/common/cnxk/roc_npa.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/common/cnxk/roc_npa.hindex f7cb4460e7..8525038810100644
Quoted 16 lines
drivers/common/cnxk/roc_npa.h +0
-1@@ -255,7 +255,7 @@ roc_npa_batch_alloc_wait(uint64_t *cache_line, unsigned int wait_us)/* Batch alloc status code is updated in bits [5:6] of the first word * of the 128 byte cache line. */ - while (((__atomic_load_n(cache_line, __ATOMIC_RELAXED) >> 5) &
0x3) ==drivers/common/cnxk/roc_npa.h +1
-0+ while (((__atomic_load_n(cache_line, __ATOMIC_ACQUIRE) >> 5) &
0x3) ==drivers/common/cnxk/roc_npa.h +0
-1ALLOC_CCODE_INVAL)if (wait_us && (plt_tsc_cycles () - start) >= ticks)break ; --2.34.1