summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDamien Millescamps <damien.millescamps@6wind.com>2013-03-29 11:34:00 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-01-15 18:08:44 +0100
commit0d953384ebdf62ae15fa9c27b74a7cbd3136a0b1 (patch)
tree67c55767b5c8db3718938e57be3590e2a0ff4587 /lib
parent4fdeb8b50cc9ed1a059ec2835ed2e25bcb3cb215 (diff)
downloaddpdk-0d953384ebdf62ae15fa9c27b74a7cbd3136a0b1.zip
dpdk-0d953384ebdf62ae15fa9c27b74a7cbd3136a0b1.tar.gz
dpdk-0d953384ebdf62ae15fa9c27b74a7cbd3136a0b1.tar.xz
mem: get hugepages config
Allow external libraries and applications to know if hugepages are enabled. Signed-off-by: Damien Millescamps <damien.millescamps@6wind.com> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/librte_eal/common/include/rte_eal.h13
-rw-r--r--lib/librte_eal/linuxapp/eal/eal.c4
2 files changed, 16 insertions, 1 deletions
diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h
index cdd88a5..31826cf 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 3c5f19a..bd20331 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -1019,3 +1019,7 @@ rte_eal_process_type(void)
return (rte_config.process_type);
}
+int rte_eal_has_hugepages(void)
+{
+ return ! internal_config.no_hugetlbfs;
+}