#include <stdint.h>
#include <sched.h>
#include <rte_per_lcore.h>
Go to the source code of this file.
Detailed Description
EAL Configuration API
Definition in file rte_eal.h.
Macro Definition Documentation
#define RTE_MAGIC 19820526 |
Magic number written by the main partition when ready.
Definition at line 52 of file rte_eal.h.
macro to get the lock of tailq in mem_config
Definition at line 191 of file rte_eal.h.
macro to get the multiple lock of mempool shared by mutiple-instance
Definition at line 196 of file rte_eal.h.
Typedef Documentation
typedef void(* rte_usage_hook_t)(const char *prgname) |
Usage function typedef used by the application usage function.
Use this function typedef to define and call rte_set_applcation_usage_hook() routine.
Definition at line 162 of file rte_eal.h.
Enumeration Type Documentation
The lcore role (used in RTE or not).
Definition at line 57 of file rte_eal.h.
The type of process in a linuxapp, multi-process setup
Definition at line 65 of file rte_eal.h.
Function Documentation
struct rte_config* rte_eal_get_configuration |
( |
void |
| ) |
|
|
read |
Get the global configuration structure.
- Returns
- A pointer to the global configuration structure.
Get a lcore's role.
- Parameters
-
lcore_id | The identifier of the lcore. |
- Returns
- The role of the lcore.
Get the process type in a multi-process setup
- Returns
- The process type
int rte_eal_iopl_init |
( |
void |
| ) |
|
Request iopl privilege for all RPL.
This function should be called by pmds which need access to ioports.
- Returns
- On success, returns 0.
- On failure, returns -1.
int rte_eal_init |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Initialize the Environment Abstraction Layer (EAL).
This function is to be executed on the MASTER lcore only, as soon as possible in the application's main() function.
The function finishes the initialization process before main() is called. It puts the SLAVE lcores in the WAIT state.
When the multi-partition feature is supported, depending on the configuration (if CONFIG_RTE_EAL_MAIN_PARTITION is disabled), this function waits to ensure that the magic number is set before returning. See also the rte_eal_get_configuration() function. Note: This behavior may change in the future.
- Parameters
-
argc | The argc argument that was given to the main() function. |
argv | The argv argument that was given to the main() function. |
- Returns
- On success, the number of parsed arguments, which is greater or equal to zero. After the call to rte_eal_init(), all arguments argv[x] with x < ret may be modified and should not be accessed by the application.
- On failure, a negative error value.
Add application usage routine callout from the eal_usage() routine.
This function allows the application to include its usage message in the EAL system usage message. The routine rte_set_application_usage_hook() needs to be called before the rte_eal_init() routine in the application.
This routine is optional for the application and will behave as if the set routine was never called as the default behavior.
- Parameters
-
usage_func | The func argument is a function pointer to the application usage routine. Called function is defined using rte_usage_hook_t typedef, which is of the form void rte_usage_func(const char * prgname). |
Calling this routine with a NULL value will reset the usage hook routine and return the current value, which could be NULL.
- Returns
- Returns the current value of the rte_application_usage pointer to allow the caller to daisy chain the usage routines if needing more then one.
int rte_eal_has_hugepages |
( |
void |
| ) |
|
Whether EAL is using huge pages (disabled by –no-huge option). The no-huge mode cannot be used with UIO poll-mode drivers like igb/ixgbe. It is useful for NIC drivers (e.g. librte_pmd_mlx4, librte_pmd_vmxnet3) or crypto drivers (e.g. librte_crypto_nitrox) provided by third-parties such as 6WIND.
- Returns
- Nonzero if hugepages are enabled.
int rte_sys_gettid |
( |
void |
| ) |
|
A wrap API for syscall gettid.
- Returns
- On success, returns the thread ID of calling process. It is always successful.
static int rte_gettid |
( |
void |
| ) |
|
|
inlinestatic |
Get system unique thread id.
- Returns
- On success, returns the thread ID of calling process. It is always successful.
Definition at line 226 of file rte_eal.h.