执行helloworld测试程序
1、export RTE_SDK=/home/chaihua/dpdk-20.05;export RTE_TARGET=x86_64-native-linuxapp-gcc
2、cd ${RTE_SDK}/examples/helloworld
3、make config T=x86_64-native-linuxapp-gcc
4、make install T=x86_64-native-linuxapp-gcc
5、./helloworld -c f -n 4
程序运行时报错,显示hugepage无法找到,
6、执行
mkdir /mnt/huge
mount -t hugetlbfs /dev/hugepages/ /mnt/huge
echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
成功运行helloworld…
执行l2fwd测试程序
modprobe uio
insmod igb_uio.ko
按上述环境make执行l2,
EAL: Error - exiting with code: 1
Cause: No Ethernet ports - bye
lspci | grep Ethernet
通过lspci -vvv结果看出,该设备上启动了4个i350(igb)以及2个x540(ixgbe)网口
将x540网口从内核驱动移除,绑定至dpdk驱动,执行:
hugepage
mount -t hugetlbfs /dev/hugepages/ /mnt/huge
echo 64 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
igb_uio
modprobe uio
Insmod igb_uio.ko
python tools/dpdk_nic_bind.py --bind=igb_uio eth2
python tools/dpdk_nic_bind.py --bind=igb_uio eth3
运行成功。
所有用到的结构体:
rte_ring
rte_eth_dev_info
rte_pktmbuf_pool_private
rte_mempool
rte_eth_conf
rte_eth_rxconf
rte_eth_txconf
rte_eth_link
rte_memzone
rte_mbuf
rte_pktmbuf