DPDK  1.7.1
Macros | Functions
rte_lcore.h File Reference
#include <rte_per_lcore.h>
#include <rte_eal.h>
#include <rte_launch.h>
#include <exec-env/rte_lcore.h>

Macros

#define LCORE_ID_ANY   -1
#define RTE_LCORE_FOREACH(i)
#define RTE_LCORE_FOREACH_SLAVE(i)

Functions

 RTE_DECLARE_PER_LCORE (unsigned, _lcore_id)
static unsigned rte_lcore_id (void)
static unsigned rte_get_master_lcore (void)
static unsigned rte_lcore_count (void)
static unsigned rte_socket_id (void)
static unsigned rte_lcore_to_socket_id (unsigned lcore_id)
static int rte_lcore_is_enabled (unsigned lcore_id)
static unsigned rte_get_next_lcore (unsigned i, int skip_master, int wrap)

Detailed Description

API for lcore and Socket Manipulation. Parts of this are execution environment specific.

Macro Definition Documentation

#define LCORE_ID_ANY   -1

Any lcore.

#define RTE_LCORE_FOREACH (   i)
Value:
for (i = rte_get_next_lcore(-1, 0, 0); \
i<RTE_MAX_LCORE; \
i = rte_get_next_lcore(i, 0, 0))

Macro to browse all running lcores.

#define RTE_LCORE_FOREACH_SLAVE (   i)
Value:
for (i = rte_get_next_lcore(-1, 1, 0); \
i<RTE_MAX_LCORE; \
i = rte_get_next_lcore(i, 1, 0))

Macro to browse all running lcores except the master lcore.

Function Documentation

RTE_DECLARE_PER_LCORE ( unsigned  ,
_lcore_id   
)

Per core "core id".

static unsigned rte_get_master_lcore ( void  )
inlinestatic

Get the id of the master lcore

Returns
the id of the master lcore
static unsigned rte_get_next_lcore ( unsigned  i,
int  skip_master,
int  wrap 
)
inlinestatic

Get the next enabled lcore ID.

Parameters
iThe current lcore (reference).
skip_masterIf true, do not return the ID of the master lcore.
wrapIf true, go back to 0 when RTE_MAX_LCORE is reached; otherwise, return RTE_MAX_LCORE.
Returns
The next lcore_id or RTE_MAX_LCORE if not found.
static unsigned rte_lcore_count ( void  )
inlinestatic

Return the number of execution units (lcores) on the system.

Returns
the number of execution units (lcores) on the system.
static unsigned rte_lcore_id ( void  )
inlinestatic

Return the ID of the execution unit we are running on.

Returns
Logical core ID
static int rte_lcore_is_enabled ( unsigned  lcore_id)
inlinestatic

Test if an lcore is enabled.

Parameters
lcore_idThe identifier of the lcore, which MUST be between 0 and RTE_MAX_LCORE-1.
Returns
True if the given lcore is enabled; false otherwise.
static unsigned rte_lcore_to_socket_id ( unsigned  lcore_id)
inlinestatic

Get the ID of the physical socket of the specified lcore

Parameters
lcore_idthe targeted lcore, which MUST be between 0 and RTE_MAX_LCORE-1.
Returns
the ID of lcoreid's physical socket
static unsigned rte_socket_id ( void  )
inlinestatic

Return the ID of the physical socket of the logical core we are running on.

Returns
the ID of current lcoreid's physical socket