Skip to content

Commit

Permalink
test/mem: fix memory autotests on FreeBSD
Browse files Browse the repository at this point in the history
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: c3e35a0 ("test/mem: check segment fd API")

Reported-by: Brandon Lo <blo@iol.unh.edu>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
  • Loading branch information
bruce-richardson authored and david-marchand committed Oct 2, 2021
1 parent 47a4f26 commit 086d426
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/test/test_memory.c
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 086d426

Please sign in to comment.