From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 42C5C43183; Tue, 17 Oct 2023 01:09:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7597940DFD; Tue, 17 Oct 2023 01:09:11 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 8820440285 for ; Tue, 17 Oct 2023 01:09:07 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id B815520B74C1; Mon, 16 Oct 2023 16:09:06 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B815520B74C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1697497746; bh=b93AE7/E0tAcOCCrMt8cTSSlyq51ibSTgYrQU5KH7ds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DfhoWE79ZreOr3Yjkr5S/uyc/EATlF9w2PVgdymRJkR1z2DqA8U8ywHQWDLlipl6B 1GkXd8A9/4CAmEwu5SAyPwGaAHpJk8U6Py2/tqEuXxvCU/gfMQPaJk4DwLmCMmrbmt B9AOu07lTLmWAZBgYajsBaQAlNpsNMMQPaHDGKsw= From: Tyler Retzlaff To: dev@dpdk.org Cc: Akhil Goyal , Anatoly Burakov , Andrew Rybchenko , Bruce Richardson , Chenbo Xia , Ciara Power , David Christensen , David Hunt , Dmitry Kozlyuk , Dmitry Malloy , Elena Agostini , Erik Gabriel Carrillo , Fan Zhang , Ferruh Yigit , Harman Kalra , Harry van Haaren , Honnappa Nagarahalli , Jerin Jacob , Konstantin Ananyev , Matan Azrad , Maxime Coquelin , Narcisa Ana Maria Vasile , Nicolas Chautru , Olivier Matz , Ori Kam , Pallavi Kadam , Pavan Nikhilesh , Reshma Pattan , Sameh Gobriel , Shijith Thotton , Sivaprasad Tummala , Stephen Hemminger , Suanming Mou , Sunil Kumar Kori , Thomas Monjalon , Viacheslav Ovsiienko , Vladimir Medvedkin , Yipeng Wang , Tyler Retzlaff Subject: [PATCH 01/21] power: fix use of rte stdatomic Date: Mon, 16 Oct 2023 16:08:45 -0700 Message-Id: <1697497745-20664-2-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1697497745-20664-1-git-send-email-roretzla@linux.microsoft.com> References: <1697497745-20664-1-git-send-email-roretzla@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org * 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 --- 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