mem: add function to check if memory is contiguous
authorAnatoly Burakov <anatoly.burakov@intel.com>
Wed, 11 Apr 2018 12:30:29 +0000 (13:30 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 11 Apr 2018 19:45:55 +0000 (21:45 +0200)
commitc8f73de36eba630204526be6af73a53466acedf2
tree61ed6050e31c653ec017c7d03178155597b3bf34
parent2a04139f66b457d069445a65fd11722d91463bcb
mem: add function to check if memory is contiguous

For now, memory is always contiguous because legacy mem mode is
enabled unconditionally, but this function will be helpful down
the line when we implement support for allocating physically
non-contiguous memory. We can no longer guarantee physically
contiguous memory unless we're in legacy or IOVA_AS_VA mode, but
we can certainly try and see if we succeed.

In addition, this would be useful for e.g. PMD's who may allocate
chunks that are smaller than the pagesize, but they must not cross
the page boundary, in which case we will be able to accommodate
that request. This function will also support non-hugepage memory.

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/common/eal_common_memalloc.c [new file with mode: 0644]
lib/librte_eal/common/eal_memalloc.h
lib/librte_eal/common/malloc_elem.c
lib/librte_eal/common/meson.build
lib/librte_eal/linuxapp/eal/Makefile