From 6bfd07670b991c30761ef74fb09f42181dbfd182 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Fri, 11 Sep 2020 22:16:53 +0200 Subject: vppinfra: support main heap with different page sizes Type: improvement Change-Id: I381fc3dec8580208d0e24637d791af69011aa83b Signed-off-by: Damjan Marion --- src/vlib/linux/pci.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/vlib/linux') diff --git a/src/vlib/linux/pci.c b/src/vlib/linux/pci.c index 168acde7288..a010e64fa13 100644 --- a/src/vlib/linux/pci.c +++ b/src/vlib/linux/pci.c @@ -1132,8 +1132,10 @@ vlib_pci_map_region_int (vlib_main_t * vm, vlib_pci_dev_handle_t h, if (p->type == LINUX_PCI_DEVICE_TYPE_UIO && addr != 0) flags |= MAP_FIXED; - *result = mmap (addr, size, PROT_READ | PROT_WRITE, flags, fd, offset); - if (*result == (void *) -1) + *result = clib_mem_vm_map_shared (addr, size, fd, offset, + "PCIe %U region %u", format_vlib_pci_addr, + vlib_pci_get_addr (vm, h), bar); + if (*result == CLIB_MEM_VM_MAP_FAILED) { error = clib_error_return_unix (0, "mmap `BAR%u'", bar); if (p->type == LINUX_PCI_DEVICE_TYPE_UIO && (fd != -1)) @@ -1337,7 +1339,7 @@ vlib_pci_device_close (vlib_main_t * vm, vlib_pci_dev_handle_t h) { if (res->size == 0) continue; - munmap (res->addr, res->size); + clib_mem_vm_unmap (res->addr); if (res->fd != -1) close (res->fd); } -- cgit 1.2.3-korg