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

Function test_memory

dpdk/app/test/test_memory.c:78–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78static int
79test_memory(void)
80{
81 uint64_t s;
82 int ret;
83
84 /*
85 * dump the mapped memory: the python-expect script checks
86 * that at least one line is dumped
87 */
88 printf("Dump memory layout\n");
89 rte_dump_physmem_layout(stdout);
90
91 /* check that memory size is != 0 */
92 s = rte_eal_get_physmem_size();
93 if (s == 0) {
94 printf("No memory detected\n");
95 return -1;
96 }
97
98 /* try to read memory (should not segfault) */
99 rte_memseg_walk(check_mem, NULL);
100
101 /* check segment fd support */
102 ret = rte_memseg_walk(check_seg_fds, NULL);
103 if (ret == 1) {
104 printf("Segment fd API is unsupported\n");
105 } else if (ret == -1) {
106 printf("Error getting segment fd's\n");
107 return -1;
108 }
109
110 return 0;
111}
112
113REGISTER_FAST_TEST(memory_autotest, false, true, test_memory);

Callers

nothing calls this directly

Calls 4

rte_dump_physmem_layoutFunction · 0.85
rte_eal_get_physmem_sizeFunction · 0.85
rte_memseg_walkFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected