MCPcopy Create free account
hub / github.com/F-Stack/f-stack / check_hugepage_sz

Function check_hugepage_sz

dpdk/lib/eal/common/malloc_heap.c:34–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32#define EXTERNAL_HEAP_MIN_SOCKET_ID (CONST_MAX((1 << 8), RTE_MAX_NUMA_NODES))
33
34static unsigned
35check_hugepage_sz(unsigned flags, uint64_t hugepage_sz)
36{
37 unsigned check_flag = 0;
38
39 if (!(flags & ~RTE_MEMZONE_SIZE_HINT_ONLY))
40 return 1;
41
42 switch (hugepage_sz) {
43 case RTE_PGSIZE_256K:
44 check_flag = RTE_MEMZONE_256KB;
45 break;
46 case RTE_PGSIZE_2M:
47 check_flag = RTE_MEMZONE_2MB;
48 break;
49 case RTE_PGSIZE_16M:
50 check_flag = RTE_MEMZONE_16MB;
51 break;
52 case RTE_PGSIZE_256M:
53 check_flag = RTE_MEMZONE_256MB;
54 break;
55 case RTE_PGSIZE_512M:
56 check_flag = RTE_MEMZONE_512MB;
57 break;
58 case RTE_PGSIZE_1G:
59 check_flag = RTE_MEMZONE_1GB;
60 break;
61 case RTE_PGSIZE_4G:
62 check_flag = RTE_MEMZONE_4GB;
63 break;
64 case RTE_PGSIZE_16G:
65 check_flag = RTE_MEMZONE_16GB;
66 }
67
68 return check_flag & flags;
69}
70
71int
72malloc_socket_to_heap_id(unsigned int socket_id)

Callers 3

find_suitable_elementFunction · 0.85
find_biggest_elementFunction · 0.85
alloc_more_mem_on_socketFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected