summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Millescamps <damien.millescamps@6wind.com>2013-03-29 11:34:00 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2013-09-17 14:16:12 +0200
commit9896f5059f9aa6003681e75530f838194862cb95 (patch)
tree14535be3691fc66c14bb9f06669ec0e6f0a27787
parent0fd24c236d10fab0ffd71f3b8dbccc7a07fb3794 (diff)
downloaddpdk-9896f5059f9aa6003681e75530f838194862cb95.zip
dpdk-9896f5059f9aa6003681e75530f838194862cb95.tar.gz
dpdk-9896f5059f9aa6003681e75530f838194862cb95.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>
-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 1df8d10..34c9f2f 100644
--- a/lib/librte_eal/common/include/rte_eal.h
+++ b/lib/librte_eal/common/include/rte_eal.h
@@ -246,7 +246,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 caf96ed..6086ca4 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -963,3 +963,7 @@ rte_eal_process_type(void)
return (rte_config.process_type);
}
+int rte_eal_has_hugepages(void)
+{
+ return ! internal_config.no_hugetlbfs;
+}