virtio: merge contiguous memory regions

Although contiguous, memory regions may appear as separate
/proc/self/maps entries.

This patch brings support for DPDK 18.05.

Change-Id: I91eb8adc2c073a103f687320ec7b9dabe1e066b3
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/413167
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Dariusz Stojaczyk 2018-06-01 00:49:49 +02:00 committed by Ben Walker
parent 51806fa7b6
commit b5ad869cc1

View File

@ -226,6 +226,14 @@ get_hugepage_file_info(struct hugepage_file_info huges[], int max)
SPDK_ERRLOG("Exceed maximum of %d\n", max);
goto error;
}
if (idx > 0 &&
strncmp(tmp, huges[idx - 1].path, PATH_MAX) == 0 &&
v_start == huges[idx - 1].addr + huges[idx - 1].size) {
huges[idx - 1].size += (v_end - v_start);
continue;
}
huges[idx].addr = v_start;
huges[idx].size = v_end - v_start;
snprintf(huges[idx].path, PATH_MAX, "%s", tmp);