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; 5+ 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] 5+ 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; 5+ 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] 5+ 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
  2025-01-22 17:00   ` Jerin Jacob
  1 sibling, 1 reply; 5+ 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] 5+ messages in thread

* RE: [PATCH v2] common/cnxk: fix atomic load in batch ops
  2024-12-02 16:57 ` [PATCH v2] common/cnxk: fix atomic load " Nawal Kishor
@ 2025-01-22 17:00   ` Jerin Jacob
  2025-01-23  4:33     ` Ashwin Sekhar T K
  0 siblings, 1 reply; 5+ messages in thread
From: Jerin Jacob @ 2025-01-22 17:00 UTC (permalink / raw)
  To: Nawal Kishor, dev, Nithin Kumar Dabilpuram,
	Kiran Kumar Kokkilagadda, Sunil Kumar Kori,
	Satha Koteswara Rao Kottidi, Harman Kalra, Ashwin Sekhar T K
  Cc: Nawal Kishor



> -----Original Message-----
> From: Nawal Kishor <nkishor@marvell.com>
> Sent: Monday, December 2, 2024 10:28 PM
> To: dev@dpdk.org; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>;
> Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori
> <skori@marvell.com>; Satha Koteswara Rao Kottidi
> <skoteshwar@marvell.com>; Harman Kalra <hkalra@marvell.com>; Ashwin
> Sekhar T K <asekhar@marvell.com>; Jerin Jacob <jerinj@marvell.com>
> Cc: Nawal Kishor <nkishor@marvell.com>
> Subject: [PATCH v2] common/cnxk: fix atomic load 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.
> 
> Fixes: 50d08d3934ec ("common/cnxk: fix batch alloc completion poll logic")
> 
> Signed-off-by: Nawal Kishor <nkishor@marvell.com>

Fixed the  following issues and applied to dpdk-next-net-mrvl/for-main. Thanks

Is it candidate for Cc: stable@dpdk.org backport?
        common/cnxk: fix atomic load in batch ops
Contributor name/email mismatch with .mailmap:
        Nawal Kishor <nkishor@marvell.com> is unknown in .mailmap


> ---
> 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] 5+ messages in thread

* RE: [PATCH v2] common/cnxk: fix atomic load in batch ops
  2025-01-22 17:00   ` Jerin Jacob
@ 2025-01-23  4:33     ` Ashwin Sekhar T K
  0 siblings, 0 replies; 5+ messages in thread
From: Ashwin Sekhar T K @ 2025-01-23  4:33 UTC (permalink / raw)
  To: Jerin Jacob, Nawal Kishor, dev, Nithin Kumar Dabilpuram,
	Kiran Kumar Kokkilagadda, Sunil Kumar Kori,
	Satha Koteswara Rao Kottidi, Harman Kalra
  Cc: Nawal Kishor

Yes. It is a candidate for backport.

Thanks
Ashwin

> -----Original Message-----
> From: Jerin Jacob <jerinj@marvell.com>
> Sent: Wednesday, January 22, 2025 10:31 PM
> To: Nawal Kishor <nkishor@marvell.com>; dev@dpdk.org; Nithin Kumar
> Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda
> <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha
> Koteswara Rao Kottidi <skoteshwar@marvell.com>; Harman Kalra
> <hkalra@marvell.com>; Ashwin Sekhar T K <asekhar@marvell.com>
> Cc: Nawal Kishor <nkishor@marvell.com>
> Subject: RE: [PATCH v2] common/cnxk: fix atomic load in batch ops
> 
> 
> 
> > -----Original Message-----
> > From: Nawal Kishor <nkishor@marvell.com>
> > Sent: Monday, December 2, 2024 10:28 PM
> > To: dev@dpdk.org; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>;
> > Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori
> > <skori@marvell.com>; Satha Koteswara Rao Kottidi
> > <skoteshwar@marvell.com>; Harman Kalra <hkalra@marvell.com>; Ashwin
> > Sekhar T K <asekhar@marvell.com>; Jerin Jacob <jerinj@marvell.com>
> > Cc: Nawal Kishor <nkishor@marvell.com>
> > Subject: [PATCH v2] common/cnxk: fix atomic load 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.
> >
> > Fixes: 50d08d3934ec ("common/cnxk: fix batch alloc completion poll
> > logic")
> >
> > Signed-off-by: Nawal Kishor <nkishor@marvell.com>
> 
> Fixed the  following issues and applied to dpdk-next-net-mrvl/for-main.
> Thanks
> 
> Is it candidate for Cc: stable@dpdk.org backport?
>         common/cnxk: fix atomic load in batch ops Contributor name/email
> mismatch with .mailmap:
>         Nawal Kishor <nkishor@marvell.com> is unknown in .mailmap
> 
> 
> > ---
> > 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] 5+ messages in thread

end of thread, other threads:[~2025-01-23  4:33 UTC | newest]

Thread overview: 5+ 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
2025-01-22 17:00   ` Jerin Jacob
2025-01-23  4:33     ` Ashwin Sekhar T K

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