patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] examples/service_cores: fix lcore count check
@ 2021-08-30  8:04 Ruifeng Wang
  2021-08-31 16:09 ` Van Haaren, Harry
  0 siblings, 1 reply; 4+ messages in thread
From: Ruifeng Wang @ 2021-08-30  8:04 UTC (permalink / raw)
  To: Harry van Haaren, Vipin Varghese
  Cc: dev, thomas, david.marchand, nd, honnappa.nagarahalli,
	Ruifeng Wang, stable

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-16 15:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30  8:04 [dpdk-stable] [PATCH] examples/service_cores: fix lcore count check Ruifeng Wang
2021-08-31 16:09 ` Van Haaren, Harry
2021-09-16 15:30   ` [dpdk-stable] [dpdk-dev] " David Marchand
2021-09-16 15:36   ` [dpdk-stable] " Thomas Monjalon

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).