* Copyright(c) 2010-2014 Intel Corporation
*/
+#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include <limits.h>
#include <rte_errno.h>
#include <rte_malloc.h>
#include "../../lib/librte_eal/common/malloc_elem.h"
+#include "../../lib/librte_eal/common/eal_memcfg.h"
#include "test.h"
#include <rte_eal.h>
#include <rte_eal_memconfig.h>
#include <rte_string_fns.h>
+#include <rte_tailq.h>
#include "test.h"
* eal: The function ``rte_eal_remote_launch`` will return new error codes
after read or write error on the pipe, instead of calling ``rte_panic``.
-* eal: the ``rte_mem_config`` struct will be made private to remove it from the
- externally visible ABI and allow it to be updated in the future.
-
* eal: both declaring and identifying devices will be streamlined in v18.11.
New functions will appear to query a specific port from buses, classes of
device and device drivers. Device declaration will be made coherent with the
Also, make sure to start the actual text at the margin.
=========================================================
+* The ``rte_mem_config`` structure has been made private. The new accessor
+ ``rte_mcfg_*`` functions were introduced to provide replacement for direct
+ access to the shared mem config.
+
* The network structures, definitions and functions have
been prefixed by ``rte_`` to resolve conflicts with libc headers.
librte_compressdev.so.1
librte_cryptodev.so.7
librte_distributor.so.1
- librte_eal.so.10
+ + librte_eal.so.11
librte_efd.so.1
librte_ethdev.so.12
+ librte_eventdev.so.7
#include <rte_eal.h>
#include <rte_bus.h>
#include <rte_spinlock.h>
+#include <rte_tailq.h>
#include "eal_filesystem.h"
ret = mlx4_mp_init_primary();
if (ret)
goto out;
- sd->init_done = true;
+ sd->init_done = 1;
break;
case RTE_PROC_SECONDARY:
if (ld->init_done)
if (ret)
goto out;
++sd->secondary_cnt;
- ld->init_done = true;
+ ld->init_done = 1;
break;
default:
break;
*/
#include <assert.h>
+#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#define RTE_PMD_MLX5_H_
#include <stddef.h>
+#include <stdbool.h>
#include <stdint.h>
#include <limits.h>
#include <net/if.h>
#include <assert.h>
#include <inttypes.h>
#include <unistd.h>
+#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <rte_string_fns.h>
#include <rte_acl.h>
+#include <rte_tailq.h>
+
#include "acl.h"
TAILQ_HEAD(rte_acl_list, rte_tailq_entry);
#include <rte_string_fns.h>
#include <rte_eal_memconfig.h>
#include <rte_pause.h>
+#include <rte_tailq.h>
#include "rte_distributor_private.h"
#include "rte_distributor.h"
#include <rte_string_fns.h>
#include <rte_eal_memconfig.h>
#include <rte_pause.h>
+#include <rte_tailq.h>
#include "rte_distributor_v20.h"
#include "rte_distributor_private.h"
#include <rte_config.h>
#include <rte_eal_memconfig.h>
+#include "eal_memcfg.h"
+
void
rte_mcfg_mem_read_lock(void)
{
#include "eal_memalloc.h"
#include "eal_private.h"
#include "eal_internal_cfg.h"
+#include "eal_memcfg.h"
#include "malloc_heap.h"
/*
#include "malloc_heap.h"
#include "malloc_elem.h"
#include "eal_private.h"
+#include "eal_memcfg.h"
static inline const struct rte_memzone *
memzone_lookup_thread_unsafe(const char *name)
#include <rte_debug.h>
#include "eal_private.h"
+#include "eal_memcfg.h"
TAILQ_HEAD(rte_tailq_elem_head, rte_tailq_elem);
/* local tailq list */
--- /dev/null
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019 Intel Corporation
+ */
+
+#ifndef EAL_MEMCFG_H
+#define EAL_MEMCFG_H
+
+#include <rte_config.h>
+#include <rte_eal_memconfig.h>
+#include <rte_malloc_heap.h>
+#include <rte_memory.h>
+#include <rte_memzone.h>
+#include <rte_pause.h>
+#include <rte_rwlock.h>
+#include <rte_tailq.h>
+
+/**
+ * Memory configuration shared across multiple processes.
+ */
+struct rte_mem_config {
+ volatile uint32_t magic; /**< Magic number - sanity check. */
+
+ /* memory topology */
+ uint32_t nchannel; /**< Number of channels (0 if unknown). */
+ uint32_t nrank; /**< Number of ranks (0 if unknown). */
+
+ /**
+ * current lock nest order
+ * - qlock->mlock (ring/hash/lpm)
+ * - mplock->qlock->mlock (mempool)
+ * Notice:
+ * *ALWAYS* obtain qlock first if having to obtain both qlock and mlock
+ */
+ 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_rwlock_t memory_hotplug_lock;
+ /**< Indicates whether memory hotplug request is in progress. */
+
+ /* memory segments and zones */
+ struct rte_fbarray memzones; /**< Memzone descriptors. */
+
+ struct rte_memseg_list memsegs[RTE_MAX_MEMSEG_LISTS];
+ /**< List of dynamic arrays holding memsegs */
+
+ struct rte_tailq_head tailq_head[RTE_MAX_TAILQ];
+ /**< Tailqs for objects */
+
+ struct malloc_heap malloc_heaps[RTE_MAX_HEAPS];
+ /**< DPDK malloc heaps */
+
+ int next_socket_id; /**< Next socket ID for external malloc heap */
+
+ /* rte_mem_config has to be mapped at the exact same address in all
+ * processes, so we need to store it.
+ */
+ uint64_t mem_cfg_addr; /**< Address of this structure in memory. */
+
+ /* Primary and secondary processes cannot run with different legacy or
+ * single file segments options, so to avoid having to specify these
+ * options to all processes, store them in shared config and update the
+ * internal config at init time.
+ */
+ uint32_t legacy_mem; /**< stored legacy mem parameter. */
+ uint32_t single_file_segments;
+ /**< stored single file segments parameter. */
+
+ uint8_t dma_maskbits; /**< Keeps the more restricted dma mask. */
+} __attribute__((packed));
+
+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();
+}
+
+#endif /* EAL_MEMCFG_H */
#ifndef _RTE_EAL_MEMCONFIG_H_
#define _RTE_EAL_MEMCONFIG_H_
-#include <rte_config.h>
-#include <rte_tailq.h>
-#include <rte_memory.h>
-#include <rte_memzone.h>
-#include <rte_malloc_heap.h>
-#include <rte_rwlock.h>
-#include <rte_pause.h>
-#include <rte_fbarray.h>
+/**
+ * @file
+ *
+ * This API allows access to EAL shared memory configuration through an API.
+ */
#ifdef __cplusplus
extern "C" {
#endif
-/**
- * memseg list is a special case as we need to store a bunch of other data
- * together with the array itself.
- */
-struct rte_memseg_list {
- RTE_STD_C11
- union {
- void *base_va;
- /**< Base virtual address for this memseg list. */
- uint64_t addr_64;
- /**< Makes sure addr is always 64-bits */
- };
- uint64_t page_sz; /**< Page size for all memsegs in this list. */
- int socket_id; /**< Socket ID for all memsegs in this list. */
- volatile uint32_t version; /**< version number for multiprocess sync. */
- size_t len; /**< Length of memory area covered by this memseg list. */
- unsigned int external; /**< 1 if this list points to external memory */
- struct rte_fbarray memseg_arr;
-};
-
-/**
- * the structure for the memory configuration for the RTE.
- * Used by the rte_config structure. It is separated out, as for multi-process
- * support, the memory details should be shared across instances
- */
-struct rte_mem_config {
- volatile uint32_t magic; /**< Magic number - Sanity check. */
-
- /* memory topology */
- uint32_t nchannel; /**< Number of channels (0 if unknown). */
- uint32_t nrank; /**< Number of ranks (0 if unknown). */
-
- /**
- * current lock nest order
- * - qlock->mlock (ring/hash/lpm)
- * - mplock->qlock->mlock (mempool)
- * Notice:
- * *ALWAYS* obtain qlock first if having to obtain both qlock and mlock
- */
- rte_rwlock_t mlock; /**< only used by memzone LIB for thread-safe. */
- rte_rwlock_t qlock; /**< used for tailq operation for thread safe. */
- rte_rwlock_t mplock; /**< only used by mempool LIB for thread-safe. */
-
- rte_rwlock_t memory_hotplug_lock;
- /**< indicates whether memory hotplug request is in progress. */
-
- /* memory segments and zones */
- struct rte_fbarray memzones; /**< Memzone descriptors. */
-
- struct rte_memseg_list memsegs[RTE_MAX_MEMSEG_LISTS];
- /**< list of dynamic arrays holding memsegs */
-
- struct rte_tailq_head tailq_head[RTE_MAX_TAILQ]; /**< Tailqs for objects */
-
- /* Heaps of Malloc */
- struct malloc_heap malloc_heaps[RTE_MAX_HEAPS];
-
- /* next socket ID for external malloc heap */
- int next_socket_id;
-
- /* address of mem_config in primary process. used to map shared config into
- * exact same address the primary process maps it.
- */
- uint64_t mem_cfg_addr;
-
- /* legacy mem and single file segments options are shared */
- uint32_t legacy_mem;
- uint32_t single_file_segments;
-
- /* keeps the more restricted dma mask */
- uint8_t dma_maskbits;
-} __attribute__((__packed__));
-
-
-inline static 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();
-}
-
/**
* Lock the internal EAL shared memory configuration for shared access.
*/
extern "C" {
#endif
-#include <stdbool.h>
#include <stdio.h>
#include <rte_compat.h>
#include <rte_common.h>
#include <rte_compat.h>
#include <rte_config.h>
-
-/* forward declaration for pointers */
-struct rte_memseg_list;
+#include <rte_fbarray.h>
__extension__
enum rte_page_sizes {
uint32_t flags; /**< Memseg-specific flags */
} __rte_packed;
+/**
+ * memseg list is a special case as we need to store a bunch of other data
+ * together with the array itself.
+ */
+struct rte_memseg_list {
+ RTE_STD_C11
+ union {
+ void *base_va;
+ /**< Base virtual address for this memseg list. */
+ uint64_t addr_64;
+ /**< Makes sure addr is always 64-bits */
+ };
+ uint64_t page_sz; /**< Page size for all memsegs in this list. */
+ int socket_id; /**< Socket ID for all memsegs in this list. */
+ volatile uint32_t version; /**< version number for multiprocess sync. */
+ size_t len; /**< Length of memory area covered by this memseg list. */
+ unsigned int external; /**< 1 if this list points to external memory */
+ struct rte_fbarray memseg_arr;
+};
+
/**
* Lock page in physical memory and prevent from swapping.
*
#include <rte_string_fns.h>
#include <rte_spinlock.h>
#include <rte_memcpy.h>
+#include <rte_memzone.h>
#include <rte_atomic.h>
#include <rte_fbarray.h>
#include "eal_internal_cfg.h"
#include "eal_memalloc.h"
+#include "eal_memcfg.h"
#include "malloc_elem.h"
#include "malloc_heap.h"
#include "malloc_mp.h"
#include <rte_string_fns.h>
#include "eal_memalloc.h"
+#include "eal_memcfg.h"
#include "malloc_elem.h"
#include "malloc_mp.h"
#include "malloc_elem.h"
#include "malloc_heap.h"
#include "eal_memalloc.h"
+#include "eal_memcfg.h"
/* Free the memory space back to heap */
EXPORT_MAP := ../../rte_eal_version.map
-LIBABIVER := 10
+LIBABIVER := 11
# specific to freebsd exec-env
SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) := eal.c
#include "eal_private.h"
#include "eal_internal_cfg.h"
#include "eal_filesystem.h"
+#include "eal_memcfg.h"
#define EAL_PAGE_SIZE (sysconf(_SC_PAGESIZE))
EXPORT_MAP := ../../rte_eal_version.map
VPATH += $(RTE_SDK)/lib/librte_eal/common/arch/$(ARCH_DIR)
-LIBABIVER := 10
+LIBABIVER := 11
VPATH += $(RTE_SDK)/lib/librte_eal/common
#include "eal_internal_cfg.h"
#include "eal_filesystem.h"
#include "eal_hugepages.h"
+#include "eal_memcfg.h"
#include "eal_options.h"
#include "eal_vfio.h"
#include "hotplug_mp.h"
#include "eal_filesystem.h"
#include "eal_internal_cfg.h"
#include "eal_memalloc.h"
+#include "eal_memcfg.h"
#include "eal_private.h"
const int anonymous_hugepages_supported =
#include "eal_private.h"
#include "eal_memalloc.h"
+#include "eal_memcfg.h"
#include "eal_internal_cfg.h"
#include "eal_filesystem.h"
#include "eal_hugepages.h"
#include <rte_vfio.h>
#include "eal_filesystem.h"
+#include "eal_memcfg.h"
#include "eal_vfio.h"
#include "eal_private.h"
dpdk_conf.set('RTE_EXEC_ENV_' + exec_env.to_upper(), 1)
subdir(exec_env + '/eal')
-version = 10 # the version of the EAL API
+version = 11 # the version of the EAL API
allow_experimental_apis = true
deps += 'kvargs'
if dpdk_conf.has('RTE_USE_LIBBSD')
#include <rte_ring.h>
#include <rte_jhash.h>
#include <rte_hash_crc.h>
+#include <rte_tailq.h>
#include "rte_efd.h"
#if defined(RTE_ARCH_X86)
#include <rte_ring.h>
#include <rte_compat.h>
#include <rte_vect.h>
+#include <rte_tailq.h>
#include "rte_hash.h"
#include "rte_cuckoo_hash.h"
#include <rte_cpuflags.h>
#include <rte_log.h>
#include <rte_spinlock.h>
+#include <rte_tailq.h>
#include "rte_fbk_hash.h"
#include <rte_errno.h>
#include <rte_rwlock.h>
#include <rte_spinlock.h>
+#include <rte_tailq.h>
#include "rte_lpm.h"
#include <rte_hash.h>
#include <assert.h>
#include <rte_jhash.h>
+#include <rte_tailq.h>
#include "rte_lpm6.h"
#include <rte_memory.h>
#include <rte_malloc.h>
#include <rte_errno.h>
+#include <rte_tailq.h>
#include "rte_member.h"
#include "rte_member_ht.h"
#include <rte_errno.h>
#include <rte_string_fns.h>
#include <rte_spinlock.h>
+#include <rte_tailq.h>
#include "rte_mempool.h"
extern "C" {
#endif
+#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <rte_eal_memconfig.h>
#include <rte_errno.h>
#include <rte_malloc.h>
+#include <rte_tailq.h>
#include "rte_reorder.h"
#include <rte_errno.h>
#include <rte_string_fns.h>
#include <rte_spinlock.h>
+#include <rte_tailq.h>
#include "rte_ring.h"