From: David Hunt Date: Mon, 7 Jan 2019 11:39:20 +0000 (+0000) Subject: examples/power: fix core id with JSON commands X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d38e6a6a454d177852bc16b4cb0622fd32852f48;p=dpdk.git examples/power: fix core id with JSON commands This patch fixes a bug introduced in the 64-core limitation enhancement where the core_id is inadvertently converted from virtual to physical even though it may already be a physical core_id. We should be using the core_type field, and only converting via hypervisor when core_type is set to CORE_TYPE_VIRTUAL Fixes: 5776b7a371d1 ("examples/power: allow VM to use lcores over 63") Signed-off-by: David Hunt Reviewed-by: Lei Yao Tested-by: Lei Yao --- diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c index 85622e7cb1..1a3a0fa768 100644 --- a/examples/vm_power_manager/channel_monitor.c +++ b/examples/vm_power_manager/channel_monitor.c @@ -640,7 +640,10 @@ process_request(struct channel_packet *pkt, struct channel_info *chan_info) if (pkt->command == CPU_POWER) { unsigned int core_num; - core_num = get_pcpu(chan_info, pkt->resource_id); + if (pkt->core_type == CORE_TYPE_VIRTUAL) + core_num = get_pcpu(chan_info, pkt->resource_id); + else + core_num = pkt->resource_id; switch (pkt->unit) { case(CPU_POWER_SCALE_MIN):