[dpdk-dev] [PATCH 4/4] power: add cmd to query CPU freq.
Hunt, David
david.hunt at intel.com
Fri Sep 27 12:40:36 CEST 2019
On 27/09/2019 11:19, Ferruh Yigit wrote:
> On 9/27/2019 10:52 AM, Daly, Lee wrote:
>>
>>> -----Original Message-----
>>> From: Hajkowski, MarcinX
>>> Sent: Wednesday, April 3, 2019 6:16 PM
>>> To: Hunt, David <david.hunt at intel.com>
>>> Cc: dev at dpdk.org; Hajkowski, MarcinX <marcinx.hajkowski at intel.com>
>>> Subject: [PATCH 4/4] power: add cmd to query CPU freq.
>>>
>>> From: Marcin Hajkowski <marcinx.hajkowski at intel.com>
>>>
>>> Add command and related logic to query CPU frequencies either for specified
>>> CPU or all cores.
>>>
>>> Signed-off-by: Marcin Hajkowski <marcinx.hajkowski at intel.com>
>>> ---
>>> .../guest_cli/vm_power_cli_guest.c | 150 ++++++++++++++++--
>>> 1 file changed, 138 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
>> <...>
>>
>>> +
>>> + pkt.command = CPU_POWER_QUERY_FREQ_LIST;
>>> + strcpy(pkt.vm_name, policy.vm_name);
>> Can you use the internal rte_strlcpy() functions for security.
> +1 to *not* use 'strcpy()', but better to use 'strlcpy()' directly,
> since there is already a wrapper for the environment that doesn't support
> 'strlcpy()' [1].
>
> [1] lib/librte_eal/common/include/rte_string_fns.h
> #define strlcpy(dst, src, size) rte_strlcpy(dst, src, size)
Agreed, I'm currently working on a respin that uses strlcpy(). Will post
soon.
Rgds,
Dave.
More information about the dev
mailing list