The multiprocess feature has been implicitly enabled so far.
Applications might want to explicitly disable like when using the
non-EAL threads registration API.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
(1 << rte_get_master_lcore()));
ret |= launch_proc(argv1);
+ printf("### Testing rte_mp_disable() reject:\n");
+ if (rte_mp_disable()) {
+ printf("Error: rte_mp_disable() has been accepted\n");
+ ret |= -1;
+ } else {
+ printf("# Checked rte_mp_disable() is refused\n");
+ }
ret |= launch_proc(argv2);
ret |= !(launch_proc(argv3));
/* Internally, the status of the mp feature is represented as a three-state:
* - "unknown" as long as no secondary process attached to a primary process
- * and there was no call to __rte_mp_disable yet,
+ * and there was no call to rte_mp_disable yet,
* - "enabled" as soon as a secondary process attaches to a primary process,
- * - "disabled" when a primary process successfully called __rte_mp_disable,
+ * - "disabled" when a primary process successfully called rte_mp_disable,
*/
enum mp_status {
MP_STATUS_UNKNOWN,
}
bool
-__rte_mp_disable(void)
+rte_mp_disable(void)
{
return set_mp_status(MP_STATUS_DISABLED);
}
rte_errno = EINVAL;
return -1;
}
- if (!__rte_mp_disable()) {
+ if (!rte_mp_disable()) {
RTE_LOG(ERR, EAL, "Multiprocess in use, registering non-EAL threads is not supported.\n");
rte_errno = EINVAL;
return -1;
rte_usage_hook_t
eal_get_application_usage_hook(void);
-/**
- * Mark primary process as not supporting multi-process.
- */
-bool __rte_mp_disable(void);
-
/**
* Instruct primary process that a secondary process wants to attach.
*/
*/
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 */
rte_lcore_callback_unregister;
rte_lcore_dump;
rte_lcore_iterate;
+ rte_mp_disable;
rte_thread_register;
rte_thread_unregister;
};
}
bool
-__rte_mp_disable(void)
+rte_mp_disable(void)
{
return true;
}