DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ruifeng Wang <ruifeng.wang@arm.com>
To: Harry van Haaren <harry.van.haaren@intel.com>,
	Vipin Varghese <vipin.varghese@intel.com>
Cc: dev@dpdk.org, thomas@monjalon.net, david.marchand@redhat.com,
	nd@arm.com, honnappa.nagarahalli@arm.com,
	Ruifeng Wang <ruifeng.wang@arm.com>,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH] examples/service_cores: fix lcore count check
Date: Mon, 30 Aug 2021 16:04:12 +0800	[thread overview]
Message-ID: <20210830080412.1548336-1-ruifeng.wang@arm.com> (raw)

The example has various profiles to run services on specified
number of lcores. Due to incorrect boundary condition, service
can be dispatched to a core that does not exist. This puts main
core into endless wait.

Max available number of service cores is all detected lcores
excluding main core.

Fixes: 7f6ee6aee717 ("examples/service_cores: check cores before run")
Cc: stable@dpdk.org
Cc: vipin.varghese@intel.com

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 examples/service_cores/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/service_cores/main.c b/examples/service_cores/main.c
index 83915b9a53..9f52082254 100644
--- a/examples/service_cores/main.c
+++ b/examples/service_cores/main.c
@@ -118,7 +118,7 @@ apply_profile(int profile_id)
 	struct profile *p = &profiles[profile_id];
 	const uint8_t core_off = 1;
 
-	if (p->num_cores > rte_lcore_count() + 1) {
+	if (p->num_cores > rte_lcore_count() - 1) {
 		printf("insufficent cores to run (%s)",
 			p->name);
 		return;
-- 
2.25.1


             reply	other threads:[~2021-08-30  8:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30  8:04 Ruifeng Wang [this message]
2021-08-31 16:09 ` Van Haaren, Harry
2021-09-16 15:30   ` David Marchand
2021-09-16 15:36   ` 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=20210830080412.1548336-1-ruifeng.wang@arm.com \
    --to=ruifeng.wang@arm.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=nd@arm.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=vipin.varghese@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).