test/threads: add unit test
[dpdk.git] / app / test / test_memory.c
index 3da803e..440e5ef 100644 (file)
@@ -6,7 +6,7 @@
 #include <stdint.h>
 
 #include <rte_eal.h>
-#include <rte_eal_memconfig.h>
+#include <rte_errno.h>
 #include <rte_memory.h>
 #include <rte_common.h>
 #include <rte_memzone.h>
  * - Try to read all memory; it should not segfault.
  */
 
+/*
+ * ASan complains about accessing unallocated memory.
+ * See: https://bugs.dpdk.org/show_bug.cgi?id=880
+ */
+__rte_no_asan
 static int
 check_mem(const struct rte_memseg_list *msl __rte_unused,
                const struct rte_memseg *ms, void *arg __rte_unused)
@@ -54,7 +59,7 @@ check_seg_fds(const struct rte_memseg_list *msl, const struct rte_memseg *ms,
                /* ENOTSUP means segment is valid, but there is not support for
                 * segment fd API (e.g. on FreeBSD).
                 */
-               if (errno == ENOTSUP)
+               if (rte_errno == ENOTSUP)
                        return 1;
                /* all other errors are treated as failures */
                return -1;
@@ -63,7 +68,7 @@ check_seg_fds(const struct rte_memseg_list *msl, const struct rte_memseg *ms,
        /* we're able to get memseg fd - try getting its offset */
        ret = rte_memseg_get_fd_offset_thread_unsafe(ms, &offset);
        if (ret < 0) {
-               if (errno == ENOTSUP)
+               if (rte_errno == ENOTSUP)
                        return 1;
                return -1;
        }