From fb7b8b32cd958f03d3e327b4cd046cf0c815d3b3 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Thu, 3 May 2018 13:38:20 +0100 Subject: [PATCH] app/testpmd: disable memory locking on FreeBSD If mlockall() is called while allocated VA space is bigger than amount of available RAM, FreeBSD kernel will deadlock and need a hard reboot. We do allocate big amounts of memory because of how new memory subsystem works, so calling mlockall() will cause a deadlock. So, disable mlockall() by default on FreeBSD. Signed-off-by: Anatoly Burakov Acked-by: Konstantin Ananyev --- app/test-pmd/testpmd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 77490be8e9..38b8b7a460 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2615,6 +2615,13 @@ main(int argc, char** argv) latencystats_enabled = 0; #endif + /* on FreeBSD, mlockall() is disabled by default */ +#ifdef RTE_EXEC_ENV_BSDAPP + do_mlockall = 0; +#else + do_mlockall = 1; +#endif + argc -= diag; argv += diag; if (argc > 1) -- 2.20.1