mem: add internal API to get and set segment fd
authorAnatoly Burakov <anatoly.burakov@intel.com>
Tue, 4 Sep 2018 15:15:47 +0000 (16:15 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 19 Sep 2018 12:46:34 +0000 (14:46 +0200)
commit1009ba1704f9cffd47d46fb8eda8671ef30e966d
treed6c9aa40aa7580c4b910cf9a4943b3a7a5ba3787
parent16cab6e5c8e1acc19f0b21ccce171ddfe2126cf7
mem: add internal API to get and set segment fd

Enable setting and retrieving segment fd's internally.

For now, retrieving fd's will not be used anywhere until we
get an external API, but it will be useful for things like
virtio, where we wish to share segment fd's.

Setting segment fd's will not be available as a public API
at this time, but internally it is needed for legacy mode,
because we're not allocating our hugepages in memalloc in
legacy mode case, and we still need to store the fd.

Another user of get segment fd API is memseg info dump, to
show which pages use which fd's.

Not supported on FreeBSD.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_eal/bsdapp/eal/eal_memalloc.c
lib/librte_eal/common/eal_common_memory.c
lib/librte_eal/common/eal_memalloc.h
lib/librte_eal/linuxapp/eal/eal_memalloc.c
lib/librte_eal/linuxapp/eal/eal_memory.c