]> git.droids-corp.org - dpdk.git/commitdiff
usertools: add option for hugetlbfs directory
authorDmitry Kozlyuk <dkozlyuk@nvidia.com>
Fri, 24 Jun 2022 13:19:52 +0000 (16:19 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 27 Jun 2022 00:24:06 +0000 (02:24 +0200)
dpdk-hugepages.py had /dev/hugepages hardcoded as the mount point.
It may be desirable to setup hugepage directory at another path,
for example, when using hugepages of multiple sizes in different
directories or when granting different permissions to mount points.
Add --directory/-d option to the script.

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
usertools/dpdk-hugepages.py

index 4fdb199744b7950c43e97cc0abd831fa52b8466e..8bab086a2f9cf2b67fb883ff3c74bc3b314563c3 100755 (executable)
@@ -228,6 +228,12 @@ To a complete setup of with 2 Gigabyte of 1G huge pages:
         '-u',
         action='store_true',
         help='unmount the system huge page directory')
+    parser.add_argument(
+        '--directory',
+        '-d',
+        metavar='DIR',
+        default=HUGE_MOUNT,
+        help='mount point')
     parser.add_argument(
         '--node', '-n', help='select numa node to reserve pages on')
     parser.add_argument(
@@ -262,7 +268,7 @@ To a complete setup of with 2 Gigabyte of 1G huge pages:
     if args.clear:
         clear_pages()
     if args.unmount:
-        umount_huge(HUGE_MOUNT)
+        umount_huge(args.directory)
 
     if args.reserve:
         reserve_kb = get_memsize(args.reserve)
@@ -273,7 +279,7 @@ To a complete setup of with 2 Gigabyte of 1G huge pages:
         reserve_pages(
             int(reserve_kb / pagesize_kb), pagesize_kb, node=args.node)
     if args.mount:
-        mount_huge(pagesize_kb, HUGE_MOUNT)
+        mount_huge(pagesize_kb, args.directory)
     if args.show:
         show_pages()
         print()