Skip to content

Instantly share code, notes, and snippets.

@kay21s
Created June 13, 2017 01:57
Show Gist options
  • Save kay21s/a0865de3f9b97621477144e400b7594a to your computer and use it in GitHub Desktop.
Save kay21s/a0865de3f9b97621477144e400b7594a to your computer and use it in GitHub Desktop.
Fix DPDK huge page sharing between primary and secondary process
Use DPDK, running primary process on the host and secondary process in docker. Following error would occur:
EAL: Cannot mmap device resource file /sys/bus/pci/devices/0000:02:00.0/resource3 to address: 0x7ffff7feb000
CAUSE: if addr is given when using mmap(), it’s just a hint, but not a must.
FIX:
In file: lib/librte_eal/common/eal_common_pci_uio.c
Add flag MAP_FIXED when calling mmap() in pci_map_resource(), that means:
78 void *mapaddr = pci_map_resource(uio_res->maps[i].addr,
79 fd, (off_t)uio_res->maps[i].offset,
80 (size_t)uio_res->maps[i].size, MAP_FIXED);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment