| 76 | } |
| 77 | |
| 78 | static int |
| 79 | test_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 | |
| 113 | REGISTER_FAST_TEST(memory_autotest, false, true, test_memory); |
nothing calls this directly
no test coverage detected