[PATCH v1 01/15] power/kvm_vm: enforce enabled lcore ID check

lihuisong (C) lihuisong at huawei.com
Wed Apr 22 11:18:20 CEST 2026


On 4/21/2026 10:23 PM, Stephen Hemminger wrote:
> On Fri, 17 Apr 2026 10:51:48 +0800
> "lihuisong (C)" <lihuisong at huawei.com> wrote:
>
>> On 4/16/2026 11:48 PM, Stephen Hemminger wrote:
>>> On Thu, 16 Apr 2026 11:05:58 +0800
>>> Huisong Li <lihuisong at huawei.com> wrote:
>>>   
>>>> The locre ID in cpufreq power must be enabled core in application.
>>> Spelling error, use checkpatch next time, it runs a spell checker.
>>> Also run devtools/check-git-log there other issues in the commit messages.
>> Sorry for this.
>> Yeah, I used checkpatch.sh and check-git-log.sh before sent out.
>> But it didn't found this. I guess that because the "locre" is not a word.
>>>> Use rte_lcore_is_enabled to verify lcore_id.
>>>>
>>>> Fixes: 6f987b594fa6 ("power: refactor core power management")
>>>> Cc: stable at dpdk.org
>>>>
>>>> Signed-off-by: Huisong Li <lihuisong at huawei.com>
>>>> ---
>>> The rte_lcore_is_enabled() will return false for service lcores.
>>> Is this a bug or a feature here?
>> My understanding is that the ROLE_RTE core is used to tasks on data
>> plane and the ROLE_SERVICE core is used to periodic or control-plane tasks.
>> Currently, power management in DPDK is mainly processed based on
>> services on the data plane, like the usage in pmd_mgmt or l3fwd-power.
>> However, the tasks on the service cores may also occupy 100% CPU.
>> Therefore, power library or driver should be able to be work with these
>> tasks.
>>   From this perspective, allowing the ROLE_SERVICE core to set power has
>> the least impact on applications in this series.
>> what do you think, Stephen?
>
> Service lcore's are just things doing other work.
> They really should not be doing non-blocking poll, that is a mistake.
> The service cores are intended for control path things.
got it.
>
> The power API should ignore them in general but not break if a user
> calls a power API from a service thread.
What you suggest is that we should allow the service core to 
successfully set the power API?
I know this approach has the least impact.

However, pmd_mgmt lib is also used together with the data plane task of 
network devices.
They should only allow the ROLE_RTE core to use them.
I originally wanted to extract a common macro to verify the lcore in 
power lib.
This common macro is not appropriate to pmd_mgmt lib if this common 
macro counts ROLE_SERVICE core as valid.

But we don't know if aplication having the service core thread used 
cpufreq API.
Although they may not be used in general, it seems that we need allow 
the service core to set the cpufreq API.


More information about the dev mailing list