summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorVipin Varghese <vipin.varghese@intel.com>2018-10-12 18:44:03 +0530
committerThomas Monjalon <thomas@monjalon.net>2018-10-29 03:05:15 +0100
commit7f6ee6aee717e4ee5ca1d3f06af5a14f897b2168 (patch)
tree3e31c25d75533c796f4e818a00beb51b175c1953 /examples
parent23021f1c6bb8a5e35cf92dfe91ca9ce171b06997 (diff)
downloaddpdk-7f6ee6aee717e4ee5ca1d3f06af5a14f897b2168.zip
dpdk-7f6ee6aee717e4ee5ca1d3f06af5a14f897b2168.tar.gz
dpdk-7f6ee6aee717e4ee5ca1d3f06af5a14f897b2168.tar.xz
examples/service_cores: check cores before run
The service core samples has varied profiles created to run on specified lcore count. The patch adds the check before each run, to ensure example has sufficent lcores to be added as service cores on given run profile. If sufficent cores are not found, the run is skipped with user notification. Signed-off-by: Vipin Varghese <vipin.varghese@intel.com> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/service_cores/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/service_cores/main.c b/examples/service_cores/main.c
index 2cd5729..c7c7928 100644
--- a/examples/service_cores/main.c
+++ b/examples/service_cores/main.c
@@ -118,6 +118,12 @@ 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) {
+ printf("insufficent cores to run (%s)",
+ p->name);
+ return;
+ }
+
for (i = 0; i < p->num_cores; i++) {
uint32_t core = i + core_off;
ret = rte_service_lcore_add(core);