1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
8 #include <rte_memory.h>
9 #include <rte_common.h>
17 * - Dump the mapped memory. The python-expect script checks that at
18 * least one line is dumped.
20 * - Check that memory size is different than 0.
22 * - Try to read all memory; it should not segfault.
26 check_mem(const struct rte_memseg *ms, void *arg __rte_unused)
28 volatile uint8_t *mem = (volatile uint8_t *) ms->addr;
31 for (i = 0; i < ms->len; i++, mem++)
42 * dump the mapped memory: the python-expect script checks
43 * that at least one line is dumped
45 printf("Dump memory layout\n");
46 rte_dump_physmem_layout(stdout);
48 /* check that memory size is != 0 */
49 s = rte_eal_get_physmem_size();
51 printf("No memory detected\n");
55 /* try to read memory (should not segfault) */
56 rte_memseg_walk(check_mem, NULL);
61 REGISTER_TEST_COMMAND(memory_autotest, test_memory);