DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] common/cnxk: use atomic load acquire in batch ops
@ 2024-08-23  6:51 Nawal Kishor
  2024-09-19 18:13 ` Jerin Jacob
  2024-12-02 16:57 ` [PATCH v2] common/cnxk: fix atomic load " Nawal Kishor
  0 siblings, 2 replies; 3+ messages in thread
From: Nawal Kishor @ 2024-08-23  6:51 UTC (permalink / raw)
  To: dev, Thomas Monjalon, Nithin Dabilpuram, Kiran Kumar K,
	Sunil Kumar Kori, Satha Rao, Harman Kalra
  Cc: jerinj, asekhar, Nawal Kishor

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(-)

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;
--
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] common/cnxk: use atomic load acquire in batch ops
  2024-08-23  6:51 [PATCH] common/cnxk: use atomic load acquire in batch ops Nawal Kishor
@ 2024-09-19 18:13 ` Jerin Jacob
  2024-12-02 16:57 ` [PATCH v2] common/cnxk: fix atomic load " Nawal Kishor
  1 sibling, 0 replies; 3+ messages in thread
From: Jerin Jacob @ 2024-09-19 18:13 UTC (permalink / raw)
  To: Nawal Kishor
  Cc: dev, Thomas Monjalon, Nithin Dabilpuram, Kiran Kumar K,
	Sunil Kumar Kori, Satha Rao, Harman Kalra, jerinj, asekhar

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 ...

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] common/cnxk: fix atomic load in batch ops
  2024-08-23  6:51 [PATCH] common/cnxk: use atomic load acquire in batch ops Nawal Kishor
  2024-09-19 18:13 ` Jerin Jacob
@ 2024-12-02 16:57 ` Nawal Kishor
  1 sibling, 0 replies; 3+ messages in thread
From: Nawal Kishor @ 2024-12-02 16:57 UTC (permalink / raw)
  To: dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori,
	Satha Rao, Harman Kalra, Ashwin Sekhar T K, Jerin Jacob
  Cc: Nawal Kishor

In roc batch alloc wait code, __ATOMIC_RELAXED is changed to
__ATOMIC_ACQUIRE in order to avoid potential out of order loads.

Fixes: 50d08d3934ec ("common/cnxk: fix batch alloc completion poll logic")

Signed-off-by: Nawal Kishor <nkishor@marvell.com>
---
v2: Fixed review comments

 drivers/common/cnxk/roc_npa.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/common/cnxk/roc_npa.h b/drivers/common/cnxk/roc_npa.h
index f7cb4460e7..8525038810 100644
--- a/drivers/common/cnxk/roc_npa.h
+++ b/drivers/common/cnxk/roc_npa.h
@@ -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;
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-12-02 16:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-23  6:51 [PATCH] common/cnxk: use atomic load acquire in batch ops Nawal Kishor
2024-09-19 18:13 ` Jerin Jacob
2024-12-02 16:57 ` [PATCH v2] common/cnxk: fix atomic load " Nawal Kishor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).