From: Sarosh Arif Date: Fri, 8 Jan 2021 09:06:27 +0000 (+0500) Subject: usertools: show error if unable to reserve hugepages X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b25f0a7df80b620bab09dcb34bf4547d31ddede1;p=dpdk.git usertools: show error if unable to reserve hugepages 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 --- diff --git a/usertools/dpdk-hugepages.py b/usertools/dpdk-hugepages.py index 4b6401dc2e..70432f9cd7 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():