On 04/11/2018 03:29 PM, Anatoly Burakov wrote:
If a user has specified that the zone should have contiguous memory, use the new _contig allocation API's instead of normal ones.
Just one minor nit.. As I understand _contig above is an artefact of the previous approach with dedicated function for contiguous allocation. If so, description should be updated to avoid confusion.
Otherwise, account for the fact that unless we're in IOVA_AS_VA mode, we cannot guarantee that the pages would be physically contiguous, so we calculate the memzone size and alignments as if we were getting the smallest page size available. However, for the non-IOVA contiguous case, existing mempool size calculation function doesn't give us expected results, because it will return memzone sizes aligned to page size (e.g. a 1MB mempool may use an entire 1GB page), therefore in cases where we weren't specifically asked to reserve non-contiguous memory, first try reserving a memzone as IOVA-contiguous, and if that fails, then try reserving with page-aligned size/alignment. Signed-off-by: Anatoly Burakov <anatoly.bura...@intel.com> Tested-by: Santosh Shukla <santosh.shu...@caviumnetworks.com> Tested-by: Hemant Agrawal <hemant.agra...@nxp.com> Tested-by: Gowrishankar Muthukrishnan <gowrishanka...@linux.vnet.ibm.com> --- lib/librte_mempool/rte_mempool.c | 148 +++++++++++++++++++++++++++++++++------ 1 file changed, 127 insertions(+), 21 deletions(-)