numam-dpdk/test
Harry van Haaren b0ee28ca12 test/debug: fix EAL cleanup when forking
Before this patch, the debug_autotest would call fork(),
call rte_panic() or rte_exit() in the child process, and
examine the return code to verify that rte_panic() and
rte_exit() were correctly reporting failures.

With the inclusion of the rte_eal_cleanup() patch, rte_exit()
was modified to cleanly tear-down EAL allocations. Currently
only one library (service cores) is allocated by EAL at startup
and should be cleaned up. This library has a check on a normal
(non-hugepage) variable to protect against double cleanup. The
service cores finalize() function itself frees back hugepage mem.

Given the fork() approach from the unit test, and the fact that
the double-free check is on an ordinary variable, causes multiple
child processed (fork()-ed from the unit-test runner) to attempt
to free the huge-page memory multiple times. The variable to
protect against double-cleanup was not effective, as the fork()
would restore it to show initialized in the next child.

The solution is to call rte_service_finalize() *before* calling
fork(), which results in the service cores double-cleanup variable
to be zero before the fork(), and hence the child processes never
free the hugepage service-cores memory (correct behavior, as the
unit-test suite is still running, and owns the hugepages).

Fixes: aec9c13c52 ("eal: add function to release internal resources")

Reported-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
2018-01-31 00:56:04 +01:00
..
cmdline_test test: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
test test/debug: fix EAL cleanup when forking 2018-01-31 00:56:04 +01:00
test-acl test: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
test-pipeline test: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
Makefile test: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
meson.build test: build app with meson as dpdk-test 2018-01-30 21:58:59 +01:00