From: Damien Millescamps Date: Fri, 29 Mar 2013 10:34:00 +0000 (+0100) Subject: mem: get hugepages config X-Git-Tag: spdx-start~10947 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c5e9eeca5a67a8272f0fdedcd0afc9b2d22be376;p=dpdk.git mem: get hugepages config Allow external libraries and applications to know if hugepages are enabled. Signed-off-by: Damien Millescamps Signed-off-by: Thomas Monjalon Acked-by: Adrien Mazarguil --- diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h index faa27f95d3..fe1323df65 100644 --- a/lib/librte_eal/common/include/rte_eal.h +++ b/lib/librte_eal/common/include/rte_eal.h @@ -251,7 +251,18 @@ rte_set_application_usage_hook( rte_usage_hook_t usage_func ); } \ } while(0) - +/** + * Whether EAL is using huge pages (disabled by --no-huge option). + * The no-huge mode cannot be used with UIO poll-mode drivers like igb/ixgbe. + * It is useful for NIC drivers (e.g. librte_pmd_mlx4, librte_pmd_vmxnet3) or + * crypto drivers (e.g. librte_crypto_nitrox) provided by third-parties such + * as 6WIND. + * + * @return + * Nonzero if hugepages are enabled. + */ +int rte_eal_has_hugepages(void); + #ifdef __cplusplus } #endif diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index 76c2f3cc07..08a96f126e 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -1086,3 +1086,7 @@ rte_eal_process_type(void) return (rte_config.process_type); } +int rte_eal_has_hugepages(void) +{ + return ! internal_config.no_hugetlbfs; +}