git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/hns3: fix queue state when concurrent with reset
[dpdk.git]
/
examples
/
service_cores
/
main.c
diff --git
a/examples/service_cores/main.c
b/examples/service_cores/main.c
index
2cd5729
..
0b3d8c8
100644
(file)
--- 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;
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);
for (i = 0; i < p->num_cores; i++) {
uint32_t core = i + core_off;
ret = rte_service_lcore_add(core);
@@
-203,10
+209,10
@@
main(int argc, char **argv)
apply_profile(i);
printf("\n==> Profile: %s\n\n", profiles[i].name);
apply_profile(i);
printf("\n==> Profile: %s\n\n", profiles[i].name);
-
sleep(1
);
+
rte_delay_us_sleep(1 * US_PER_S
);
rte_service_dump(stdout, UINT32_MAX);
rte_service_dump(stdout, UINT32_MAX);
-
sleep(5
);
+
rte_delay_us_sleep(5 * US_PER_S
);
rte_service_dump(stdout, UINT32_MAX);
i++;
rte_service_dump(stdout, UINT32_MAX);
i++;