1
2
3
4
5#ifndef EAL_MEMALLOC_H
6#define EAL_MEMALLOC_H
7
8#include <stdbool.h>
9
10#include <rte_memory.h>
11
12
13
14
15struct rte_memseg *
16eal_memalloc_alloc_seg(size_t page_sz, int socket);
17
18
19
20
21
22
23
24
25
26
27int
28eal_memalloc_alloc_seg_bulk(struct rte_memseg **ms, int n_segs, size_t page_sz,
29 int socket, bool exact);
30
31
32
33
34int
35eal_memalloc_free_seg(struct rte_memseg *ms);
36
37
38
39
40
41
42int
43eal_memalloc_free_seg_bulk(struct rte_memseg **ms, int n_segs);
44
45
46
47
48
49bool
50eal_memalloc_is_contig(const struct rte_memseg_list *msl, void *start,
51 size_t len);
52
53
54int
55eal_memalloc_sync_with_primary(void);
56
57int
58eal_memalloc_mem_event_callback_register(const char *name,
59 rte_mem_event_callback_t clb, void *arg);
60
61int
62eal_memalloc_mem_event_callback_unregister(const char *name, void *arg);
63
64void
65eal_memalloc_mem_event_notify(enum rte_mem_event event, const void *start,
66 size_t len);
67
68int
69eal_memalloc_mem_alloc_validator_register(const char *name,
70 rte_mem_alloc_validator_t clb, int socket_id, size_t limit);
71
72int
73eal_memalloc_mem_alloc_validator_unregister(const char *name, int socket_id);
74
75int
76eal_memalloc_mem_alloc_validate(int socket_id, size_t new_len);
77
78
79int
80eal_memalloc_get_seg_fd(int list_idx, int seg_idx);
81
82
83int
84eal_memalloc_set_seg_fd(int list_idx, int seg_idx, int fd);
85
86
87int
88eal_memalloc_set_seg_list_fd(int list_idx, int fd);
89
90int
91eal_memalloc_get_seg_fd_offset(int list_idx, int seg_idx, size_t *offset);
92
93int
94eal_memalloc_init(void);
95
96#endif
97