Skip to content

Commit

Permalink
common/cnxk: fix atomic load in batch ops
Browse files Browse the repository at this point in the history
In roc batch alloc wait code, __ATOMIC_RELAXED is changed to
__ATOMIC_ACQUIRE in order to avoid potential out of order loads.

Fixes: 50d08d3 ("common/cnxk: fix batch alloc completion poll logic")
Cc: [email protected]

Signed-off-by: Nawal Kishor <[email protected]>
  • Loading branch information
Nawal Kishor authored and jerinjacobk committed Jan 22, 2025
1 parent e931818 commit ccde23a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,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]>
Expand Down
2 changes: 1 addition & 1 deletion drivers/common/cnxk/roc_npa.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ccde23a

Please sign in to comment.