[dpdk-dev] [v3 PATCH] usertools: show an error message if unable to reserve requested hugepages
Sarosh Arif
sarosh.arif at emumba.com
Fri Jan 8 10:06:27 CET 2021
Sometimes the system is unable to reserve the requested hugepages because
enough space is not available in the RAM. In that case, currently the
script displays no error message hence the user can be under the delusion
that the hugepages requested are all successfully reserved. This patch
displays an error message if the pages reserved are different from the
requested pages.
Signed-off-by: Sarosh Arif <sarosh.arif at emumba.com>
---
v2:
use a global variable SHOW_HUGEPAGES to remove linter warnings
v3:
only print an error message if unable to reserve hugepages.
---
usertools/dpdk-hugepages.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/usertools/dpdk-hugepages.py b/usertools/dpdk-hugepages.py
index 1be100ca3..1523be20a 100755
--- a/usertools/dpdk-hugepages.py
+++ b/usertools/dpdk-hugepages.py
@@ -62,6 +62,8 @@ def set_hugepages(path, pages):
filename = os.path.basename(path)
size = filename[10:]
sys.exit('{} is not a valid system huge page size'.format(size))
+ if get_hugepages(path) != pages:
+ sys.exit("Unable to reserve required pages.")
def show_numa_pages():
--
2.25.1
More information about the dev
mailing list