MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_thread_register

Function rte_thread_register

dpdk/lib/eal/common/eal_common_thread.c:363–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361}
362
363int
364rte_thread_register(void)
365{
366 unsigned int lcore_id;
367 rte_cpuset_t cpuset;
368
369 /* EAL init flushes all lcores, we can't register before. */
370 if (eal_get_internal_configuration()->init_complete != 1) {
371 RTE_LOG(DEBUG, EAL, "Called %s before EAL init.\n", __func__);
372 rte_errno = EINVAL;
373 return -1;
374 }
375 if (!rte_mp_disable()) {
376 RTE_LOG(ERR, EAL, "Multiprocess in use, registering non-EAL threads is not supported.\n");
377 rte_errno = EINVAL;
378 return -1;
379 }
380 if (rte_thread_get_affinity_by_id(rte_thread_self(), &cpuset) != 0)
381 CPU_ZERO(&cpuset);
382 lcore_id = eal_lcore_non_eal_allocate();
383 if (lcore_id >= RTE_MAX_LCORE)
384 lcore_id = LCORE_ID_ANY;
385 __rte_thread_init(lcore_id, &cpuset);
386 if (lcore_id == LCORE_ID_ANY) {
387 rte_errno = ENOMEM;
388 return -1;
389 }
390 RTE_LOG(DEBUG, EAL, "Registered non-EAL thread as lcore %u.\n",
391 lcore_id);
392 return 0;
393}
394
395void
396rte_thread_unregister(void)

Callers 1

thread_loopFunction · 0.85

Calls 6

__rte_thread_initFunction · 0.85
rte_mp_disableFunction · 0.70
rte_thread_selfFunction · 0.50

Tested by 1

thread_loopFunction · 0.68