net/hns3: refactor queue info dump
[dpdk.git] / examples / service_cores / main.c
index 0b3d8c8..9f52082 100644 (file)
@@ -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;
 }