eal/linux: allow hugetlbfs sub-directories
authorJohn Levon <john.levon@nutanix.com>
Tue, 12 Oct 2021 16:05:20 +0000 (17:05 +0100)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 12 Oct 2021 19:07:46 +0000 (21:07 +0200)
commit24d5a1ce6b85aa44b4ddd04f0e7ebe8750a28def
tree8d7a4e8bd27a79df50f284b263ea56663dc1dbc4
parent8c745bb62340e7b6a3ad61e5d79dfceebd4c28e4
eal/linux: allow hugetlbfs sub-directories

get_hugepage_dir() was implemented in such a way that a --huge-dir
option had to exactly match the mountpoint, but there's no reason for
this restriction: DPDK might not be the only user of hugepages, and
shouldn't assume it owns an entire mountpoint. For example, if I have
/dev/hugepages/myapp, and /dev/hugepages/dpdk, I should be able to
specify:

--huge-dir=/dev/hugepages/dpdk/

and have DPDK only use that sub-directory.

Fix the implementation to allow a sub-directory within a suitable
hugetlbfs mountpoint to be specified, preferring the closest match.

Signed-off-by: John Levon <john.levon@nutanix.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
app/test/test_eal_flags.c
doc/guides/linux_gsg/linux_eal_parameters.rst
doc/guides/rel_notes/release_21_11.rst
lib/eal/linux/eal_hugepage_info.c