[dpdk-dev] [PATCH v1 06/13] app/test: exclude ENOTSUP as failure

Jie Zhou jizh at linux.microsoft.com
Wed Aug 18 08:17:49 CEST 2021


Check rte_errno to exclude ENOTSUP as failures in test_memory.c

Signed-off-by: Jie Zhou <jizh at linux.microsoft.com>
---
 app/test/test_memory.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/app/test/test_memory.c b/app/test/test_memory.c
index 7d5ae99bab..6f4fc02c03 100644
--- a/app/test/test_memory.c
+++ b/app/test/test_memory.c
@@ -9,6 +9,7 @@
 #include <rte_memory.h>
 #include <rte_common.h>
 #include <rte_memzone.h>
+#include <rte_errno.h>
 
 #include "test.h"
 
@@ -53,7 +54,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;
@@ -62,7 +63,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;
 	}
-- 
2.32.0.windows.2



More information about the dev mailing list