From: Damien Millescamps <damien.millescamps@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 1/2] mem: get hugepages config
Date: Fri, 26 Jul 2013 16:39:12 +0200 [thread overview]
Message-ID: <0e095118447ebbd42f2762edbda8218b13b58a1a.1374849076.git.damien.millescamps@6wind.com> (raw)
In-Reply-To: <cover.1374849076.git.damien.millescamps@6wind.com>
In-Reply-To: <cover.1374849076.git.damien.millescamps@6wind.com>
Allow external libraries and applications to know if hugepages
are enabled.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: Damien Millescamps <damien.millescamps@6wind.com>
---
lib/librte_eal/common/include/rte_eal.h | 13 ++++++++++++-
lib/librte_eal/linuxapp/eal/eal.c | 4 ++++
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 240530d..58a6f90 100644
--- a/lib/librte_eal/common/include/rte_eal.h
+++ b/lib/librte_eal/common/include/rte_eal.h
@@ -214,7 +214,18 @@ int rte_eal_init(int argc, char **argv);
} \
} 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 ed0e9b1..52de2b6 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -945,3 +945,7 @@ rte_eal_process_type(void)
return (rte_config.process_type);
}
+int rte_eal_has_hugepages(void)
+{
+ return ! internal_config.no_hugetlbfs;
+}
--
1.7.2.5
next prev parent reply other threads:[~2013-07-26 14:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-26 14:39 [dpdk-dev] [PATCH 0/2] fix mempool when --no-huge option is set Damien Millescamps
2013-07-26 14:39 ` Damien Millescamps [this message]
2013-07-26 14:59 ` [dpdk-dev] [PATCH 1/2] mem: get hugepages config Adrien Mazarguil
2013-07-26 15:10 ` Thomas Monjalon
2013-07-26 14:39 ` [dpdk-dev] [PATCH 2/2] mem: fix mempool for --no-huge Damien Millescamps
2013-07-26 14:59 ` Adrien Mazarguil
2013-07-26 15:10 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0e095118447ebbd42f2762edbda8218b13b58a1a.1374849076.git.damien.millescamps@6wind.com \
--to=damien.millescamps@6wind.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).