From patchwork Mon Jan 7 11:39:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hunt, David" X-Patchwork-Id: 49474 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4AB181B44A; Mon, 7 Jan 2019 12:39:42 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 6F7161B445 for ; Mon, 7 Jan 2019 12:39:40 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jan 2019 03:39:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,450,1539673200"; d="scan'208";a="116072576" Received: from silpixa00399952.ir.intel.com (HELO silpixa00399952.ger.corp.intel.com) ([10.237.223.64]) by orsmga003.jf.intel.com with ESMTP; 07 Jan 2019 03:39:37 -0800 From: David Hunt To: dev@dpdk.org Cc: david.hunt@intel.com, lei.a.yao@intel.com Date: Mon, 7 Jan 2019 11:39:20 +0000 Message-Id: <20190107113920.37748-1-david.hunt@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] examples/power: fix wrong core_id with JSON cmds X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch fixes a bug introduced in the 64-core limtation 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 --- examples/vm_power_manager/channel_monitor.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c index 85622e7cb..1a3a0fa76 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):