/* Maximum thread_name length. */
#define RTE_MAX_THREAD_NAME_LEN 16
-/**
- * The lcore role (used in RTE or not).
- */
-enum rte_lcore_role_t {
- ROLE_RTE,
- ROLE_OFF,
- ROLE_SERVICE,
-};
-
/**
* The type of process in a linux, multi-process setup
*/
/**
* Initialize the Environment Abstraction Layer (EAL).
*
- * This function is to be executed on the MASTER lcore only, as soon
+ * This function is to be executed on the MAIN 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.
+ * It puts the WORKER lcores in the WAIT state.
*
* @param argc
* A non-negative value. If it is greater than 0, the array members
* be made. It is expected that common usage of this function is to call it
* just before terminating the process.
*
- * @return 0 Successfully released all internal EAL resources
- * @return -EFAULT There was an error in releasing all resources.
+ * @return
+ * - 0 Successfully released all internal EAL resources.
+ * - -EFAULT There was an error in releasing all resources.
*/
int rte_eal_cleanup(void);
*/
int rte_eal_primary_proc_alive(const char *config_file_path);
+/**
+ * Disable multiprocess.
+ *
+ * This function can be called to indicate that multiprocess won't be used for
+ * the rest of the application life.
+ *
+ * @return
+ * - true if called from a primary process that had no secondary processes
+ * attached,
+ * - false, otherwise.
+ */
+__rte_experimental
+bool rte_mp_disable(void);
+
#define RTE_MP_MAX_FD_NUM 8 /* The max amount of fds */
#define RTE_MP_MAX_NAME_LEN 64 /* The max length of action name */
#define RTE_MP_MAX_PARAM_LEN 256 /* The max length of param */
*/
int rte_sys_gettid(void);
+RTE_DECLARE_PER_LCORE(int, _thread_id);
+
/**
* Get system unique thread id.
*
*/
static inline int rte_gettid(void)
{
- static RTE_DEFINE_PER_LCORE(int, _thread_id) = -1;
if (RTE_PER_LCORE(_thread_id) == -1)
RTE_PER_LCORE(_thread_id) = rte_sys_gettid();
return RTE_PER_LCORE(_thread_id);