eal/freebsd: ignore in-memory option

Message ID 20210913143424.185713-1-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series eal/freebsd: ignore in-memory option |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-mellanox-Performance fail Performance Testing issues
ci/iol-aarch64-compile-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing fail Testing issues
ci/iol-intel-Performance success Performance Testing PASS

Commit Message

Bruce Richardson Sept. 13, 2021, 2:34 p.m. UTC
  The in-memory option is not supported on FreeBSD so print a warning and
ignore the flag when it is specified for BSD apps. The lack of support
is due to the different way in which memory is managed on FreeBSD using
the contigmem driver rather than via a hugetlbfs filesystem.

Fixes: 14de8734c401 ("eal: add --in-memory option")
Cc: anatoly.burakov@intel.com

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/eal/freebsd/eal.c | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Thomas Monjalon Oct. 13, 2021, 3:11 p.m. UTC | #1
13/09/2021 16:34, Bruce Richardson:
> The in-memory option is not supported on FreeBSD so print a warning and
> ignore the flag when it is specified for BSD apps. The lack of support
> is due to the different way in which memory is managed on FreeBSD using
> the contigmem driver rather than via a hugetlbfs filesystem.
> 
> Fixes: 14de8734c401 ("eal: add --in-memory option")
> Cc: anatoly.burakov@intel.com
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Applied with Cc:stable, thanks.
  

Patch

diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index 6cee5ae369..fb734012a4 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -718,6 +718,10 @@  rte_eal_init(int argc, char **argv)
 
 	/* FreeBSD always uses legacy memory model */
 	internal_conf->legacy_mem = true;
+	if (internal_conf->in_memory) {
+		RTE_LOG(WARNING, EAL, "Warning: ignoring unsupported flag, '%s'\n", OPT_IN_MEMORY);
+		internal_conf->in_memory = false;
+	}
 
 	if (eal_plugins_init() < 0) {
 		rte_eal_init_alert("Cannot init plugins");