common/cnxk: use atomic load acquire in batch ops

Message ID 20240823065104.2254919-1-nkishor@marvell.com (mailing list archive)
State Changes Requested
Delegated to: Jerin Jacob
Headers
Series common/cnxk: use atomic load acquire in batch ops |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Nawal Kishor Aug. 23, 2024, 6:51 a.m. UTC
In roc batch alloc wait code, __ATOMIC_RELAXED is changed to
__ATOMIC_ACQUIRE in order to avoid potential out of order loads.

Signed-off-by: Nawal Kishor <nkishor@marvell.com>
---
 .mailmap                      | 1 +
 drivers/common/cnxk/roc_npa.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

--
2.34.1
  

Comments

Jerin Jacob Sept. 19, 2024, 6:13 p.m. UTC | #1
On Fri, Aug 23, 2024 at 12:21 PM Nawal Kishor <nkishor@marvell.com> wrote:
>
> In roc batch alloc wait code, __ATOMIC_RELAXED is changed to
> __ATOMIC_ACQUIRE in order to avoid potential out of order loads.
>
> Signed-off-by: Nawal Kishor <nkishor@marvell.com>

Could you add Fixes:

And change subject to common/cnxk: fix ...
  

Patch

diff --git a/.mailmap b/.mailmap
index 4a508bafad..14226ccd2d 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1046,6 +1046,7 @@  Natanael Copa <ncopa@alpinelinux.org>
 Nathan Brown <nathan.brown@arm.com>
 Nathan Law <nlaw@brocade.com>
 Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
+Nawal Kishor <nkishor@marvell.com>
 Neel Patel <neel.patel@amd.com> <neel@pensando.io>
 Neil Horman <nhorman@tuxdriver.com>
 Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
diff --git a/drivers/common/cnxk/roc_npa.h b/drivers/common/cnxk/roc_npa.h
index 4ad5f044b5..ebc2a62536 100644
--- a/drivers/common/cnxk/roc_npa.h
+++ b/drivers/common/cnxk/roc_npa.h
@@ -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;