DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hajkowski <marcinx.hajkowski@intel.com>
To: david.hunt@intel.com
Cc: dev@dpdk.org, Marcin Hajkowski <marcinx.hajkowski@intel.com>,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH] examples/guest_cli: fix hardcoded lcoreid
Date: Thu, 28 Mar 2019 12:28:41 +0100	[thread overview]
Message-ID: <20190328112841.13848-1-marcinx.hajkowski@intel.com> (raw)

From: Marcin Hajkowski <marcinx.hajkowski@intel.com>

In current implementation lcoreid 1 is used regardless
of currently available cores. This change introduce dynamic
core selection for sending policy.

Fixes: d191f08533 ("examples/guest_cli: add send policy to host")
Cc: stable@dpdk.org

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
---
 .../vm_power_manager/guest_cli/vm_power_cli_guest.c    | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
index 2d9e7689a..bd3cee904 100644
--- a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
+++ b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
@@ -188,8 +188,16 @@ static inline int
 send_policy(struct channel_packet *pkt)
 {
 	int ret;
+	unsigned int lcore_id;
 
-	ret = rte_power_guest_channel_send_msg(pkt, 1);
+	/* Get first enabled lcore. */
+	lcore_id = rte_get_next_lcore(-1,
+			0,
+			0);
+	if (lcore_id == RTE_MAX_LCORE)
+		return -1;
+
+	ret = rte_power_guest_channel_send_msg(pkt, lcore_id);
 	if (ret == 0)
 		return 1;
 	RTE_LOG(DEBUG, POWER, "Error sending message: %s\n",
-- 
2.17.2

             reply	other threads:[~2019-03-28 11:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28 11:28 Hajkowski [this message]
2019-03-28 11:28 ` Hajkowski
2019-04-01 16:09 ` Pattan, Reshma
2019-04-01 16:09   ` Pattan, Reshma

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=20190328112841.13848-1-marcinx.hajkowski@intel.com \
    --to=marcinx.hajkowski@intel.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /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).