X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Fcommon%2Feal_memcfg.h;h=ea013a9daf17b68e9f20b84d09ef890818a97f11;hb=e863fe3a13da89787fdf3b5c590101a3c0f10af6;hp=e5b90e31d2ef23f6ef247a4ff86037955ba87b9a;hpb=0d6e584247379c0a76db29073954d3e11c659660;p=dpdk.git diff --git a/lib/librte_eal/common/eal_memcfg.h b/lib/librte_eal/common/eal_memcfg.h index e5b90e31d2..ea013a9daf 100644 --- a/lib/librte_eal/common/eal_memcfg.h +++ b/lib/librte_eal/common/eal_memcfg.h @@ -5,20 +5,22 @@ #ifndef EAL_MEMCFG_H #define EAL_MEMCFG_H -#include -#include -#include #include #include #include +#include #include #include +#include "malloc_heap.h" + /** * Memory configuration shared across multiple processes. */ struct rte_mem_config { volatile uint32_t magic; /**< Magic number - sanity check. */ + uint32_t version; + /**< Prevent secondary processes using different DPDK versions. */ /* memory topology */ uint32_t nchannel; /**< Number of channels (0 if unknown). */ @@ -34,10 +36,13 @@ struct rte_mem_config { rte_rwlock_t mlock; /**< used by memzones for thread safety. */ rte_rwlock_t qlock; /**< used by tailqs for thread safety. */ rte_rwlock_t mplock; /**< used by mempool library for thread safety. */ + rte_spinlock_t tlock; /**< used by timer library for thread safety. */ rte_rwlock_t memory_hotplug_lock; /**< Indicates whether memory hotplug request is in progress. */ + uint8_t mp_status; /**< Multiprocess status. */ + /* memory segments and zones */ struct rte_fbarray memzones; /**< Memzone descriptors. */ @@ -66,15 +71,30 @@ struct rte_mem_config { uint32_t single_file_segments; /**< stored single file segments parameter. */ + uint64_t tsc_hz; + /**< TSC rate */ + uint8_t dma_maskbits; /**< Keeps the more restricted dma mask. */ }; -static inline void -rte_eal_mcfg_wait_complete(struct rte_mem_config *mcfg) -{ - /* wait until shared mem_config finish initialising */ - while (mcfg->magic != RTE_MAGIC) - rte_pause(); -} +/* update internal config from shared mem config */ +void +eal_mcfg_update_internal(void); + +/* update shared mem config from internal config */ +void +eal_mcfg_update_from_internal(void); + +/* wait until primary process initialization is complete */ +void +eal_mcfg_wait_complete(void); + +/* check if DPDK version of current process matches one stored in the config */ +int +eal_mcfg_check_version(void); + +/* set mem config as complete */ +void +eal_mcfg_complete(void); #endif /* EAL_MEMCFG_H */