Skip to content

Commit

Permalink
examples/service_cores: fix lcore count check
Browse files Browse the repository at this point in the history
[ upstream commit 328720c ]

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: 7f6ee6a ("examples/service_cores: check cores before run")

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
  • Loading branch information
Ruifeng Wang authored and cpaelzer committed Nov 30, 2021
1 parent 72a15cb commit f07a95e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/service_cores/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f07a95e

Please sign in to comment.