DPDK
18.11.6
lib
librte_eal
common
include
rte_eal_memconfig.h
1
/* SPDX-License-Identifier: BSD-3-Clause
2
* Copyright(c) 2010-2014 Intel Corporation
3
*/
4
5
#ifndef _RTE_EAL_MEMCONFIG_H_
6
#define _RTE_EAL_MEMCONFIG_H_
7
8
#include <rte_config.h>
9
#include <
rte_tailq.h
>
10
#include <
rte_memory.h
>
11
#include <
rte_memzone.h
>
12
#include <rte_malloc_heap.h>
13
#include <
rte_rwlock.h
>
14
#include <
rte_pause.h
>
15
#include <
rte_fbarray.h
>
16
17
#ifdef __cplusplus
18
extern
"C"
{
19
#endif
20
25
struct
rte_memseg_list
{
26
RTE_STD_C11
27
union
{
28
void
*
base_va
;
30
uint64_t
addr_64
;
32
};
33
uint64_t
page_sz
;
34
int
socket_id
;
35
volatile
uint32_t
version
;
36
size_t
len
;
37
unsigned
int
external
;
38
struct
rte_fbarray memseg_arr;
39
};
40
46
struct
rte_mem_config
{
47
volatile
uint32_t
magic
;
49
/* memory topology */
50
uint32_t
nchannel
;
51
uint32_t
nrank
;
60
rte_rwlock_t
mlock
;
61
rte_rwlock_t
qlock
;
62
rte_rwlock_t
mplock
;
64
rte_rwlock_t
memory_hotplug_lock
;
67
/* memory segments and zones */
68
struct
rte_fbarray
memzones
;
70
struct
rte_memseg_list
memsegs
[RTE_MAX_MEMSEG_LISTS];
73
struct
rte_tailq_head
tailq_head
[RTE_MAX_TAILQ];
75
/* Heaps of Malloc */
76
struct
malloc_heap
malloc_heaps[RTE_MAX_HEAPS];
77
78
/* next socket ID for external malloc heap */
79
int
next_socket_id;
80
81
/* address of mem_config in primary process. used to map shared config into
82
* exact same address the primary process maps it.
83
*/
84
uint64_t mem_cfg_addr;
85
86
/* legacy mem and single file segments options are shared */
87
uint32_t legacy_mem;
88
uint32_t single_file_segments;
89
90
/* keeps the more restricted dma mask */
91
uint8_t dma_maskbits;
92
} __attribute__((__packed__));
93
94
95
inline
static
void
96
rte_eal_mcfg_wait_complete(
struct
rte_mem_config
* mcfg)
97
{
98
/* wait until shared mem_config finish initialising */
99
while
(mcfg->
magic
!=
RTE_MAGIC
)
100
rte_pause
();
101
}
102
103
#ifdef __cplusplus
104
}
105
#endif
106
107
#endif
/*__RTE_EAL_MEMCONFIG_H_*/
rte_pause.h
rte_tailq_head
Definition:
rte_tailq.h:40
rte_memory.h
rte_rwlock.h
rte_mem_config::magic
volatile uint32_t magic
Definition:
rte_eal_memconfig.h:47
rte_mem_config::memzones
struct rte_fbarray memzones
Definition:
rte_eal_memconfig.h:68
rte_fbarray.h
rte_mem_config::qlock
rte_rwlock_t qlock
Definition:
rte_eal_memconfig.h:61
rte_mem_config::tailq_head
struct rte_tailq_head tailq_head[RTE_MAX_TAILQ]
Definition:
rte_eal_memconfig.h:73
rte_memseg_list::len
size_t len
Definition:
rte_eal_memconfig.h:36
rte_memseg_list
Definition:
rte_eal_memconfig.h:25
rte_memseg_list::base_va
void * base_va
Definition:
rte_eal_memconfig.h:28
rte_memseg_list::addr_64
uint64_t addr_64
Definition:
rte_eal_memconfig.h:30
rte_pause
static void rte_pause(void)
rte_memseg_list::version
volatile uint32_t version
Definition:
rte_eal_memconfig.h:35
rte_mem_config
Definition:
rte_eal_memconfig.h:46
rte_memseg_list::external
unsigned int external
Definition:
rte_eal_memconfig.h:37
rte_memseg_list::socket_id
int socket_id
Definition:
rte_eal_memconfig.h:34
malloc_heap
Definition:
rte_malloc_heap.h:23
rte_mem_config::mplock
rte_rwlock_t mplock
Definition:
rte_eal_memconfig.h:62
rte_tailq.h
rte_mem_config::memsegs
struct rte_memseg_list memsegs[RTE_MAX_MEMSEG_LISTS]
Definition:
rte_eal_memconfig.h:70
RTE_STD_C11
#define RTE_STD_C11
Definition:
rte_common.h:37
rte_memzone.h
rte_mem_config::nrank
uint32_t nrank
Definition:
rte_eal_memconfig.h:51
rte_mem_config::memory_hotplug_lock
rte_rwlock_t memory_hotplug_lock
Definition:
rte_eal_memconfig.h:64
rte_rwlock_t
Definition:
rte_rwlock.h:33
RTE_MAGIC
#define RTE_MAGIC
Definition:
rte_eal.h:29
rte_mem_config::nchannel
uint32_t nchannel
Definition:
rte_eal_memconfig.h:50
rte_memseg_list::page_sz
uint64_t page_sz
Definition:
rte_eal_memconfig.h:33
rte_mem_config::mlock
rte_rwlock_t mlock
Definition:
rte_eal_memconfig.h:60
Generated by
1.8.17