- Build rootfs and device tree with Makefile. Run:
make DPDK_LIB=<DPDK_LIB_PATH>
- Upload the images to a TFTP server and boot the kernel via U-Boot. Example:
dhcp; tftpboot 0x40000000 /maaxboard_terryb/linux_dpdk/Image; tftpboot 0x5f000000 /maaxboard_terryb/linux_dpdk/linux.dtb; tftpboot 0x4c000000 /maaxboard_terryb/linux_dpdk/initramfs.img; setenv bootargs "console=ttymxc0,115200 rootfstype=ext4 root=/dev/mmcblk0p2 rw rootwait debug default_hugepagesz=2M hugepagesz=2M hugepages=256"; booti 0x40000000 0x4c000000 0x5f000000
Note: the address of device tree should be high enough to avoid overwritting the rootfs.
- Create VM with QEMU/KVM for benchmarking:
qemu-system-aarch64 -machine virt,gic-version=3,iommu=smmuv3 -cpu cortex-a53 \
-nographic \
-kernel guest_linux_image \
-initrd guest_rootfs.cpio.gz \
-serial mon:stdio \
-netdev user,id=net0,hostfwd=udp::1235-:1235,hostfwd=tcp::8037-:8037,hostfwd=udp::5201-:5201,hostfwd=tcp::5201-:5201 \
-device virtio-net-pci,netdev=net0,mac=52:54:00:12:34:56 \
-m 1024 \
-enable-kvm
- Run DPDK example application:
echo 256 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
mkdir -p /mnt/huge
mount -t hugetlbfs -o pagesize=2M none /mnt/huge
./dpdk_devbind.py --bind=vfio-pci 0000:00:01.0 --noiommu-mode
./test_dpdk_app --iova-mode=pa