VPP内存相关配置
nr_hugepages - hugepages默認(rèn)配置為2GB。
max_map_count - 單個(gè)進(jìn)程可使用的內(nèi)存映射的數(shù)量默認(rèn)為3096,其值應(yīng)當(dāng)大于hugepages數(shù)量的2倍,每個(gè)頁面可能使用到2個(gè)maps。
hugetlb_shm_group - 默認(rèn)為0,允許所有的用戶組訪問hugepages。
shmmax - 默認(rèn)為2G,即hugepages的大小。
以上配置文件安裝到系統(tǒng)位置:/etc/sysctl.d/80-vpp.conf,在啟動(dòng)時(shí),下發(fā)到內(nèi)核中。
掛載hugetlbfs
Ubuntu系統(tǒng)中的systemd文件dev-hugepages.mount,將hugetlbfs文件系統(tǒng)掛載到目錄/dev/hugepages。
$ cat /lib/systemd/system/dev-hugepages.mount [Unit] Description=Huge Pages File System Documentation=https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems DefaultDependencies=no Before=sysinit.target ConditionPathExists=/sys/kernel/mm/hugepages ConditionCapability=CAP_SYS_ADMIN ConditionVirtualization=!private-users[Mount] What=hugetlbfs Where=/dev/hugepages Type=hugetlbfs可使用mount命令查看掛載情況。
$ mount | grep hugetlbfs hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)hugepages不足問題
引起DPDK加載網(wǎng)卡接口失敗的問題,如下函數(shù)i40e_init_fdir_filter_list分配內(nèi)存失敗。
/ # /bin/vpp -c /etc/vpp/startup.conf dpdk [notice]: EAL: Detected CPU lcores: 4 dpdk [notice]: EAL: Detected NUMA nodes: 1 dpdk [notice]: EAL: Detected static linkage of DPDK dpdk [notice]: EAL: Selected IOVA mode 'PA' dpdk [notice]: EAL: No free 1048576 kB hugepages reported on node 0 dpdk [notice]: EAL: 8 hugepages of size 2097152 reserved, but no mounted hugetlbfs found for that size dpdk [notice]: EAL: Using memfd is not supported, falling back to anonymous hugepages dpdk [notice]: EAL: Probe PCI driver: net_i40e (8086:1572) device: 0000:01:00.0 (socket 0) dpdk [notice]: EAL: Probe PCI driver: net_i40e (8086:1572) device: 0000:01:00.1 (socket 0) dpdk [notice]: EAL: Probe PCI driver: net_i40e (8086:1572) device: 0000:01:00.2 (socket 0) dpdk [notice]: EAL: Probe PCI driver: net_i40e (8086:1572) device: 0000:01:00.3 (socket 0) dpdk [notice]: i40e_init_fdir_filter_list(): Failed to allocate memory for fdir filter array! dpdk [notice]: ethdev initialisation failed dpdk [notice]: EAL: Requested device 0000:01:00.3 cannot be used dpdk [notice]: EAL: VFIO support not initialized dpdk [notice]: EAL: Couldn't map new region for DMA總結(jié)
- 上一篇: 三菱PLC定位控制2
- 下一篇: VPP学习路线