X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fservice_cores%2Fmain.c;h=9f520822546b71bd89e8d7d0cc3dd001755c6945;hb=da2c1aa41ed1b72b888b7defaf2e274607e0e555;hp=0b3d8c807384c6d9853b8fa71e8351b0b0b1d982;hpb=89813a522e68076e6f50ec18b075fa57cc5ae937;p=dpdk.git diff --git a/examples/service_cores/main.c b/examples/service_cores/main.c index 0b3d8c8073..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; @@ -176,6 +176,7 @@ main(int argc, char **argv) for (i = 0; i < NUM_SERVICES; i++) { services[i].callback_userdata = 0; uint32_t id; + /* Register a service as an application. 8< */ ret = rte_service_component_register(&services[i], &id); if (ret) rte_exit(-1, "service register() failed"); @@ -198,6 +199,7 @@ main(int argc, char **argv) ret = rte_service_runstate_set(id, 1); if (ret) return -ENOEXEC; + /* >8 End of registering a service as an application. */ } i = 0; @@ -220,5 +222,8 @@ main(int argc, char **argv) i = 0; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; }