[23.11 2/2] power: fix log message when checking lcore ID

Xueming Li xuemingl at nvidia.com
Thu Dec 12 15:08:27 CET 2024


Hi David,

Thanks for the fixes, will apply and create a new tag for it.

________________________________
From: David Marchand <david.marchand at redhat.com>
Sent: Thursday, December 12, 2024 9:23 PM
To: stable at dpdk.org <stable at dpdk.org>; Xueming Li <xuemingl at nvidia.com>
Subject: [23.11 2/2] power: fix log message when checking lcore ID

Caught while inspecting changes backported in 23.11 LTS branch.
The POWER_LOG() macro in the main branch automatically appends a \n
which is not done by RTE_LOG().

Fixes: 1afa4c7c5ea6 ("power: fix mapped lcore ID")

Signed-off-by: David Marchand <david.marchand at redhat.com>
---
 lib/power/power_amd_pstate_cpufreq.c | 2 +-
 lib/power/power_common.c             | 4 ++--
 lib/power/power_pstate_cpufreq.c     | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/power/power_amd_pstate_cpufreq.c b/lib/power/power_amd_pstate_cpufreq.c
index 7b8e77003f..ff63e91183 100644
--- a/lib/power/power_amd_pstate_cpufreq.c
+++ b/lib/power/power_amd_pstate_cpufreq.c
@@ -377,7 +377,7 @@ power_amd_pstate_cpufreq_init(unsigned int lcore_id)
         }

         if (power_get_lcore_mapped_cpu_id(lcore_id, &pi->lcore_id) < 0) {
-               RTE_LOG(ERR, POWER, "Cannot get CPU ID mapped for lcore %u", lcore_id);
+               RTE_LOG(ERR, POWER, "Cannot get CPU ID mapped for lcore %u\n", lcore_id);
                 return -1;
         }

diff --git a/lib/power/power_common.c b/lib/power/power_common.c
index 8ffb49ef8f..ee0c264c8d 100644
--- a/lib/power/power_common.c
+++ b/lib/power/power_common.c
@@ -211,8 +211,8 @@ int power_get_lcore_mapped_cpu_id(uint32_t lcore_id, uint32_t *cpu_id)

         lcore_cpus = rte_lcore_cpuset(lcore_id);
         if (CPU_COUNT(&lcore_cpus) != 1) {
-               RTE_LOG(ERR, POWER, "Power library does not support lcore %u mapping to %u CPUs", lcore_id,
-                       CPU_COUNT(&lcore_cpus));
+               RTE_LOG(ERR, POWER, "Power library does not support lcore %u mapping to %u CPUs\n",
+                       lcore_id, CPU_COUNT(&lcore_cpus));
                 return -1;
         }

diff --git a/lib/power/power_pstate_cpufreq.c b/lib/power/power_pstate_cpufreq.c
index 890875bd93..fa9ef2aa8a 100644
--- a/lib/power/power_pstate_cpufreq.c
+++ b/lib/power/power_pstate_cpufreq.c
@@ -565,7 +565,7 @@ power_pstate_cpufreq_init(unsigned int lcore_id)
         }

         if (power_get_lcore_mapped_cpu_id(lcore_id, &pi->lcore_id) < 0) {
-               RTE_LOG(ERR, POWER, "Cannot get CPU ID mapped for lcore %u", lcore_id);
+               RTE_LOG(ERR, POWER, "Cannot get CPU ID mapped for lcore %u\n", lcore_id);
                 return -1;
         }

--
2.47.0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/stable/attachments/20241212/797948d4/attachment.htm>


More information about the stable mailing list