DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] fix enable_stdatomic=true build with clang
@ 2023-10-16 18:53 Tyler Retzlaff
  2023-10-16 18:53 ` [PATCH 1/2] power: fix use of rte stdatomic Tyler Retzlaff
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Tyler Retzlaff @ 2023-10-16 18:53 UTC (permalink / raw)
  To: dev, david.marchand
  Cc: Anatoly Burakov, David Hunt, Pavan Nikhilesh, Shijith Thotton,
	Sivaprasad Tummala, Tyler Retzlaff

We are temporarily exposed while the CI is enabled that tests
CC=clang && -Denable_stdatomic.

In the meantime two mistakes have been found so fix them to allow
the CI to be enabled.

Tyler Retzlaff (2):
  power: fix use of rte stdatomic
  event/cnxk: remove single use of rte stdatomic

 drivers/event/cnxk/cnxk_tim_worker.c |  2 +-
 lib/power/power_amd_pstate_cpufreq.c | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

-- 
1.8.3.1


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

* [PATCH 1/2] power: fix use of rte stdatomic
  2023-10-16 18:53 [PATCH 0/2] fix enable_stdatomic=true build with clang Tyler Retzlaff
@ 2023-10-16 18:53 ` Tyler Retzlaff
  2023-10-16 18:53 ` [PATCH 2/2] event/cnxk: remove single " Tyler Retzlaff
  2023-10-16 19:07 ` [PATCH 0/2] fix enable_stdatomic=true build with clang David Marchand
  2 siblings, 0 replies; 5+ messages in thread
From: Tyler Retzlaff @ 2023-10-16 18:53 UTC (permalink / raw)
  To: dev, david.marchand
  Cc: Anatoly Burakov, David Hunt, Pavan Nikhilesh, Shijith Thotton,
	Sivaprasad Tummala, Tyler Retzlaff

* rte stdatomic functions operate on RTE_ATOMIC(T) specified types not
  regular T add missing specifier for amd_pstate_power_info state field
* use rte_memory_order_xxx instead of __ATOMIC_XXX

Fixes: 1ed04d33cf19 ("power: support amd-pstate cpufreq driver")
Cc: sivaprasad.tummala@amd.com

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/power/power_amd_pstate_cpufreq.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/power/power_amd_pstate_cpufreq.c b/lib/power/power_amd_pstate_cpufreq.c
index ee58395..dbd9d2b 100644
--- a/lib/power/power_amd_pstate_cpufreq.c
+++ b/lib/power/power_amd_pstate_cpufreq.c
@@ -47,7 +47,7 @@ enum power_state {
  */
 struct amd_pstate_power_info {
 	uint32_t lcore_id;                   /**< Logical core id */
-	uint32_t state;                      /**< Power in use state */
+	RTE_ATOMIC(uint32_t) state;          /**< Power in use state */
 	FILE *f;                             /**< FD of scaling_setspeed */
 	char governor_ori[28];               /**< Original governor name */
 	uint32_t curr_idx;                   /**< Freq index in freqs array */
@@ -370,7 +370,7 @@ struct amd_pstate_power_info {
 	 */
 	if (!rte_atomic_compare_exchange_strong_explicit(&(pi->state),
 					&exp_state, POWER_ONGOING,
-					__ATOMIC_ACQUIRE, __ATOMIC_RELAXED)) {
+					rte_memory_order_acquire, rte_memory_order_relaxed)) {
 		RTE_LOG(INFO, POWER, "Power management of lcore %u is "
 				"in use\n", lcore_id);
 		return -1;
@@ -408,12 +408,12 @@ struct amd_pstate_power_info {
 	RTE_LOG(INFO, POWER, "Initialized successfully for lcore %u "
 			"power management\n", lcore_id);
 
-	rte_atomic_store_explicit(&(pi->state), POWER_USED, __ATOMIC_RELEASE);
+	rte_atomic_store_explicit(&(pi->state), POWER_USED, rte_memory_order_release);
 
 	return 0;
 
 fail:
-	rte_atomic_store_explicit(&(pi->state), POWER_UNKNOWN, __ATOMIC_RELEASE);
+	rte_atomic_store_explicit(&(pi->state), POWER_UNKNOWN, rte_memory_order_release);
 	return -1;
 }
 
@@ -448,7 +448,7 @@ struct amd_pstate_power_info {
 	 */
 	if (!rte_atomic_compare_exchange_strong_explicit(&(pi->state),
 					&exp_state, POWER_ONGOING,
-					__ATOMIC_ACQUIRE, __ATOMIC_RELAXED)) {
+					rte_memory_order_acquire, rte_memory_order_relaxed)) {
 		RTE_LOG(INFO, POWER, "Power management of lcore %u is "
 				"not used\n", lcore_id);
 		return -1;
@@ -468,12 +468,12 @@ struct amd_pstate_power_info {
 	RTE_LOG(INFO, POWER, "Power management of lcore %u has exited from "
 			"'userspace' mode and been set back to the "
 			"original\n", lcore_id);
-	rte_atomic_store_explicit(&(pi->state), POWER_IDLE, __ATOMIC_RELEASE);
+	rte_atomic_store_explicit(&(pi->state), POWER_IDLE, rte_memory_order_release);
 
 	return 0;
 
 fail:
-	rte_atomic_store_explicit(&(pi->state), POWER_UNKNOWN, __ATOMIC_RELEASE);
+	rte_atomic_store_explicit(&(pi->state), POWER_UNKNOWN, rte_memory_order_release);
 
 	return -1;
 }
-- 
1.8.3.1


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

* [PATCH 2/2] event/cnxk: remove single use of rte stdatomic
  2023-10-16 18:53 [PATCH 0/2] fix enable_stdatomic=true build with clang Tyler Retzlaff
  2023-10-16 18:53 ` [PATCH 1/2] power: fix use of rte stdatomic Tyler Retzlaff
@ 2023-10-16 18:53 ` Tyler Retzlaff
  2023-10-16 19:07 ` [PATCH 0/2] fix enable_stdatomic=true build with clang David Marchand
  2 siblings, 0 replies; 5+ messages in thread
From: Tyler Retzlaff @ 2023-10-16 18:53 UTC (permalink / raw)
  To: dev, david.marchand
  Cc: Anatoly Burakov, David Hunt, Pavan Nikhilesh, Shijith Thotton,
	Sivaprasad Tummala, Tyler Retzlaff

The variable operated on by the single use of rte stdatomic was not
RTE_ATOMIC(T) specified. Remove the use of stdatomic for now to fix
LLVM build with enable_stdatomic=true. event/cnxk will be converted
to rte stdatomic in a later series.

Fixes: 14a4aa9eae71 ("event/cnxk: support get remaining ticks")
Cc: pbhagavatula@marvell.com

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 drivers/event/cnxk/cnxk_tim_worker.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/event/cnxk/cnxk_tim_worker.c b/drivers/event/cnxk/cnxk_tim_worker.c
index ae4bf33..944490d 100644
--- a/drivers/event/cnxk/cnxk_tim_worker.c
+++ b/drivers/event/cnxk/cnxk_tim_worker.c
@@ -193,7 +193,7 @@
 		return -ENOENT;
 
 	bkt = (struct cnxk_tim_bkt *)evtim->impl_opaque[1];
-	sema = rte_atomic_load_explicit(&bkt->w1, rte_memory_order_acquire);
+	sema = __atomic_load_n(&bkt->w1, rte_memory_order_acquire);
 	if (cnxk_tim_bkt_get_hbt(sema) || !cnxk_tim_bkt_get_nent(sema))
 		return -ENOENT;
 
-- 
1.8.3.1


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

* Re: [PATCH 0/2] fix enable_stdatomic=true build with clang
  2023-10-16 18:53 [PATCH 0/2] fix enable_stdatomic=true build with clang Tyler Retzlaff
  2023-10-16 18:53 ` [PATCH 1/2] power: fix use of rte stdatomic Tyler Retzlaff
  2023-10-16 18:53 ` [PATCH 2/2] event/cnxk: remove single " Tyler Retzlaff
@ 2023-10-16 19:07 ` David Marchand
  2023-10-17  6:50   ` David Marchand
  2 siblings, 1 reply; 5+ messages in thread
From: David Marchand @ 2023-10-16 19:07 UTC (permalink / raw)
  To: Tyler Retzlaff
  Cc: dev, Anatoly Burakov, David Hunt, Pavan Nikhilesh,
	Shijith Thotton, Sivaprasad Tummala

On Mon, Oct 16, 2023 at 8:53 PM Tyler Retzlaff
<roretzla@linux.microsoft.com> wrote:
>
> We are temporarily exposed while the CI is enabled that tests
> CC=clang && -Denable_stdatomic.
>
> In the meantime two mistakes have been found so fix them to allow
> the CI to be enabled.
>
> Tyler Retzlaff (2):
>   power: fix use of rte stdatomic
>   event/cnxk: remove single use of rte stdatomic

Thank you for the fixes.
Reviewed-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand


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

* Re: [PATCH 0/2] fix enable_stdatomic=true build with clang
  2023-10-16 19:07 ` [PATCH 0/2] fix enable_stdatomic=true build with clang David Marchand
@ 2023-10-17  6:50   ` David Marchand
  0 siblings, 0 replies; 5+ messages in thread
From: David Marchand @ 2023-10-17  6:50 UTC (permalink / raw)
  To: Tyler Retzlaff
  Cc: dev, Anatoly Burakov, David Hunt, Pavan Nikhilesh,
	Shijith Thotton, Sivaprasad Tummala

On Mon, Oct 16, 2023 at 9:07 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Mon, Oct 16, 2023 at 8:53 PM Tyler Retzlaff
> <roretzla@linux.microsoft.com> wrote:
> >
> > We are temporarily exposed while the CI is enabled that tests
> > CC=clang && -Denable_stdatomic.
> >
> > In the meantime two mistakes have been found so fix them to allow
> > the CI to be enabled.
> >
> > Tyler Retzlaff (2):
> >   power: fix use of rte stdatomic
> >   event/cnxk: remove single use of rte stdatomic
>
> Thank you for the fixes.
> Reviewed-by: David Marchand <david.marchand@redhat.com>

Series applied, thanks.

-- 
David Marchand


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

end of thread, other threads:[~2023-10-17  6:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-16 18:53 [PATCH 0/2] fix enable_stdatomic=true build with clang Tyler Retzlaff
2023-10-16 18:53 ` [PATCH 1/2] power: fix use of rte stdatomic Tyler Retzlaff
2023-10-16 18:53 ` [PATCH 2/2] event/cnxk: remove single " Tyler Retzlaff
2023-10-16 19:07 ` [PATCH 0/2] fix enable_stdatomic=true build with clang David Marchand
2023-10-17  6:50   ` David Marchand

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