mem: get hugepages config for bsd
authorOlivier Matz <olivier.matz@6wind.com>
Fri, 25 Apr 2014 11:59:47 +0000 (13:59 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 29 Apr 2014 23:28:18 +0000 (01:28 +0200)
The bsdapp part was missing in c5e9eeca5a67a8272f0fdedcd0afc9b2d22be376.

This commit allows external libraries and applications to know if
hugepages are enabled.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
lib/librte_eal/bsdapp/eal/eal.c

index e944aba..7bac352 100644 (file)
@@ -759,6 +759,12 @@ rte_eal_mcfg_complete(void)
                rte_config.mem_config->magic = RTE_MAGIC;
 }
 
+/* return non-zero if hugepages are enabled. */
+int rte_eal_has_hugepages(void)
+{
+       return !internal_config.no_hugetlbfs;
+}
+
 /* Abstraction for port I/0 privilage */
 static int
 rte_eal_iopl_init(void)