DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Hunt <david.hunt@intel.com>
To: dev@dpdk.org
Cc: david.hunt@intel.com, lei.a.yao@intel.com
Subject: [dpdk-dev] [PATCH] examples/power: fix wrong core_id with JSON cmds
Date: Mon,  7 Jan 2019 11:39:20 +0000	[thread overview]
Message-ID: <20190107113920.37748-1-david.hunt@intel.com> (raw)

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 <david.hunt@intel.com>
---
 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):
-- 
2.17.1

             reply	other threads:[~2019-01-07 11:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 11:39 David Hunt [this message]
2019-01-08  2:02 ` Yao, Lei A
2019-01-08  9:20   ` Hunt, David
2019-01-08 12:47     ` Yao, Lei A
2019-01-14 23:15       ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190107113920.37748-1-david.hunt@intel.com \
    --to=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=lei.a.yao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).