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 function f started on the remote lcore ✨
  • (-EBUSY): The remote lcore is not in a WAIT state 😬
  • (-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 β€” If call_main is set to SKIP_MAIN, the MAIN lcore does not call the function. If call_main is set to CALL_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 of f on the other lcores πŸ™ˆ.

Returns

  • 0: Success. Execution of function f started on all remote lcores ✨
  • (-EBUSY): At least one remote lcore is not in a WAIT state. 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 the worker_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