From: Dmitry Kozlyuk Date: Fri, 24 Jun 2022 13:19:52 +0000 (+0300) Subject: usertools: add option for hugetlbfs directory X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=31af02ef6f7cc5166a6afd636883255805376c40;p=dpdk.git usertools: add option for hugetlbfs directory 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 Acked-by: Bruce Richardson --- diff --git a/usertools/dpdk-hugepages.py b/usertools/dpdk-hugepages.py index 4fdb199744..8bab086a2f 100755 --- a/usertools/dpdk-hugepages.py +++ b/usertools/dpdk-hugepages.py @@ -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()