eal: add internal flag of init completed
authorAnatoly Burakov <anatoly.burakov@intel.com>
Tue, 13 Mar 2018 17:42:35 +0000 (17:42 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 21 Mar 2018 17:42:34 +0000 (18:42 +0100)
Currently, primary process initialization is finalized by setting
the RTE_MAGIC value in the shared config. However, it is not
possible to check whether secondary process initialization has
completed. Add such a value to internal config.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_eal/common/eal_common_options.c
lib/librte_eal/common/eal_internal_cfg.h
lib/librte_eal/linuxapp/eal/eal.c

index 9f2f8d2..0be80cb 100644 (file)
@@ -194,6 +194,7 @@ eal_reset_internal_config(struct internal_config *internal_cfg)
        internal_cfg->vmware_tsc_map = 0;
        internal_cfg->create_uio_dev = 0;
        internal_cfg->user_mbuf_pool_ops_name = NULL;
+       internal_cfg->init_complete = 0;
 }
 
 static int
index 1169fcc..a0082d1 100644 (file)
@@ -56,6 +56,8 @@ struct internal_config {
                        /**< user defined mbuf pool ops name */
        unsigned num_hugepage_sizes;      /**< how many sizes on this system */
        struct hugepage_info hugepage_info[MAX_HUGEPAGE_SIZES];
+       volatile unsigned int init_complete;
+       /**< indicates whether EAL has completed initialization */
 };
 extern struct internal_config internal_config; /**< Global EAL configuration. */
 
index 38306bf..2ecd07b 100644 (file)
@@ -669,6 +669,8 @@ rte_eal_mcfg_complete(void)
        /* ALL shared mem_config related INIT DONE */
        if (rte_config.process_type == RTE_PROC_PRIMARY)
                rte_config.mem_config->magic = RTE_MAGIC;
+
+       internal_config.init_complete = 1;
 }
 
 /*