mem: support mapping hugepages at runtime
authorAnatoly Burakov <anatoly.burakov@intel.com>
Wed, 11 Apr 2018 12:30:26 +0000 (13:30 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 11 Apr 2018 17:56:37 +0000 (19:56 +0200)
commit582bed1e1d1ddfd51bc7d61b95b0b8b55e47c6f9
tree62bdb76abe031314c7049fcbdc038d51e0c7b97c
parent49df3db848832118156570fe07643b16f652d4de
mem: support mapping hugepages at runtime

Nothing uses this code yet. The bulk of it is copied from old
memory allocation code (linuxapp eal_memory.c). We provide an
EAL-internal API to allocate either one page or multiple pages,
guaranteeing that we'll get contiguous VA for all of the pages
that we requested.

Not supported on FreeBSD.

Locking is done via fcntl() because that way, when it comes to
taking out write locks or unlocking on deallocation, we don't
have to keep original fd's around. Plus, using fcntl() gives us
ability to lock parts of a file, which is useful for single-file
segments, which are coming down the line.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
lib/librte_eal/bsdapp/eal/Makefile
lib/librte_eal/bsdapp/eal/eal_memalloc.c [new file with mode: 0644]
lib/librte_eal/bsdapp/eal/meson.build
lib/librte_eal/common/eal_memalloc.h [new file with mode: 0644]
lib/librte_eal/linuxapp/eal/Makefile
lib/librte_eal/linuxapp/eal/eal_memalloc.c [new file with mode: 0644]
lib/librte_eal/linuxapp/eal/meson.build