timer: fix resource leak in finalize
[dpdk.git] / lib / librte_eal / common / eal_memcfg.h
index 5732338..359beb2 100644 (file)
@@ -11,6 +11,7 @@
 #include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_pause.h>
+#include <rte_spinlock.h>
 #include <rte_rwlock.h>
 #include <rte_tailq.h>
 
@@ -19,6 +20,8 @@
  */
 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,6 +37,7 @@ 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. */
@@ -81,6 +85,10 @@ eal_mcfg_update_from_internal(void);
 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);