Skip to contentSkip to conversation

app/test: fix memory autotests on FreeBSD

PATCH Applied Bruce Richardson 2 participants 2 messages Sep 17, 2021 – Oct 2, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/test: fix memory autotests on FreeBSD

The memory autotests were failing on FreeBSD, due to an incorrect errno variable being checked for ENOTSUP. The test checked "errno" while the DPDK API sets "rte_errno". Changing to check the right variable makes the test behave properly.

Fixes c3e35a0966b8 ("test/mem: check segment fd API")
---
 app/test/test_memory.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
app/test/test_memory.c +2 -1
index 7d5ae99bab..dbf6871e71 100644
@@ -6,6 +6,7 @@
 #include <stdint.h>
 
 #include <rte_eal.h>
+#include <rte_errno.h>
 #include <rte_memory.h>
 #include <rte_common.h>
 #include <rte_memzone.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;
Signature · 1 line
2.32.0
Reviewed-by on v1 1/1 Applied
#1 lore raw
Quoted 10 lines · Bruce Richardson

The memory autotests were failing on FreeBSD, due to an incorrect errno variable being checked for ENOTSUP. The test checked "errno" while the DPDK API sets "rte_errno". Changing to check the right variable makes the test behave properly.

Fixes c3e35a0966b8 ("test/mem: check segment fd API")

Applied, thanks.

Signature · 1 line
David Marchand