rte_launch.h(3)
πΈ NAME πΈ
bestie, this is the manpage for rte_launch.h β it's the DPDK header that lets you yeet tasks onto other lcores π
(that's the "Library Functions Manual" section of the manual, for the record, so you know exactly which vibe you're in β¨).
π SYNOPSIS π
π Typedefs
typedef int lcore_function_t(void *)
π¦ Enumerations
enum rte_lcore_state_t { WAIT, RUNNING }
enum rte_rmt_call_main_t { SKIP_MAIN = 0, CALL_MAIN }
π Functions
int rte_eal_remote_launch (lcore_function_t *f, void *arg, unsigned worker_id)
int rte_eal_mp_remote_launch (lcore_function_t *f, void *arg, enum rte_rmt_call_main_t call_main)
enum rte_lcore_state_t rte_eal_get_lcore_state (unsigned int worker_id)
int rte_eal_wait_lcore (unsigned worker_id)
void rte_eal_mp_wait_lcore (void)
β¨ Detailed Description β¨
okay so the whole point of this file is: launch tasks on other lcores. That's the mission statement, no notes π₯.
Definition in file rte_launch.h.
π Typedef Documentation π
πΈ typedef int lcore_function_t(void *)
This is literally just the definition of a remote launch function β the shape of the thing you're allowed to yeet at another core π«Ά.
Definition at line 31 of file rte_launch.h.
π Enumeration Type Documentation π
β enum rte_lcore_state_t
the state of an lcore, bestie β that's it, that's the enum π.
Enumerator
WAITβ waiting for new command π΄RUNNINGβ executing command πβοΈ
Definition at line 21 of file rte_launch.h.
β enum rte_rmt_call_main_t
This one tells you whether the main core is required to execute the handler that's being launched on all logical cores π.
Enumerator
SKIP_MAINβ the lcore handler is not executed by the main core πCALL_MAINβ the lcore handler is executed by the main core πͺ
Definition at line 73 of file rte_launch.h.
π₯ Function Documentation π₯
π int rte_eal_remote_launch (lcore_function_t * f, void * arg, unsigned worker_id)
Launch a function on another lcore. iconic behaviour, truly π
To be executed on the MAIN lcore only.
So here's the tea: it sends a message to a worker lcore (identified by the worker_id) that is sitting in the WAIT state β and yes, that's true after the first call to rte_eal_init(). wanna check first? call rte_eal_wait_lcore(worker_id) and see π.
When the remote lcore gets that message, it switches to the RUNNING state, then calls the function f with argument arg. Once it's done executing, the remote lcore switches back to WAIT state, and the return value of f is stored in a local variable so you can read it later with rte_eal_wait_lcore() π.
The MAIN lcore returns the second the message is sent β it knows absolutely nothing about whether f finished π.
Note: This function is not designed to offer optimum performance. It is just a practical way to launch a function on another lcore at initialization time. (she's convenient, not fast, and she's at peace with that π )
Parameters
fβ The function to be called.argβ The argument for the function.worker_idβ The identifier of the lcore on which the function should be executed.
Returns
0: Success. Execution of functionfstarted on the remote lcore β¨(-EBUSY): The remote lcore is not in aWAITstate π¬(-EPIPE): Error reading or writing pipe to worker thread π
π int rte_eal_mp_remote_launch (lcore_function_t * f, void * arg, enum rte_rmt_call_main_t call_main)
Launch a function on all lcores. all of them. every single one. no lcore left behind π«Ά
It checks that each WORKER lcore is in a WAIT state, then calls rte_eal_remote_launch() for each lcore π.
Parameters
fβ The function to be called.argβ The argument for the function.call_mainβ Ifcall_mainis set toSKIP_MAIN, the MAIN lcore does not call the function. Ifcall_mainis set toCALL_MAIN, the function is also called on main before returning. In any case, the main lcore returns as soon as it finished its job and knows nothing about the completion offon the other lcores π.
Returns
0: Success. Execution of functionfstarted on all remote lcores β¨(-EBUSY): At least one remote lcore is not in aWAITstate. In this case, no message is sent to any of the lcores π± (all-or-nothing, periodt)
π enum rte_lcore_state_t rte_eal_get_lcore_state (unsigned int worker_id)
Get the state of the lcore identified by worker_id. vibe check for a core, basically πΈ
To be executed on the MAIN lcore only.
Parameters
worker_idβ The identifier of the lcore.
Returns
The state of the lcore π
π int rte_eal_wait_lcore (unsigned worker_id)
Wait until an lcore finishes its job. patient main character energy β¨
To be executed on the MAIN lcore only.
If the lcore identified by the worker_id is in RUNNING state, wait until the lcore finishes its job and moves to the WAIT state π¦.
Parameters
worker_idβ The identifier of the lcore.
Returns
0: If the remote launch function was never called on the lcore identified by theworker_id.- The value that was returned by the previous remote launch function call π
π void rte_eal_mp_wait_lcore (void )
Wait until all lcores finish their jobs. the group hangout version π
To be executed on the MAIN lcore only. It issues an rte_eal_wait_lcore() for every lcore. The return values are ignored β she's not reading the receipts, she's just waiting π.
After a call to rte_eal_mp_wait_lcore(), the caller can assume that all worker lcores are in a WAIT state π
π Author π
Generated automatically by Doxygen for DPDK from the source code. (not a human, just a robot doing her little thing π€β¨)
okay bestie that's the whole page, no cap π«Ά this was DPDK, Version 25.11.3, and it's rte_launch.h(3) β go forth and launch responsibly, mwah π
π
π¦ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 Β· BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms