vpp 2206编译 # ./extras/vagrant/build.sh # make build # make run startup-default.conf 的内容 cpu { main-core 0 } unix { interactive cli-listen 127.0.0.1:5002 log /tmp/vpp.log full-coredump startup-config /home/king/share/vpp/startup.txt } dpdk { uio-driver igb_uio dev 0000:03:00.0 { name dpdk0 } } session { enable use-app-socket-api evt_qs_memfd_seg } socksvr { socket-name /var/run/vpp/vcl-api.sock } api-trace { on } plugins { # path /home/king/share/vpp/build-root/build-vpp-native/vpp/lib/x86_64-linux-gnu/vpp_plugins/ plugin oddbuf_plugin.so { enable } } vcl配置 vcl { heapsize 64M segment-size 4000000000 add-segment-size 4000000000 rx-fifo-size 4000000 tx-fifo-size 4000000 app-socket-api /run/vpp/app_ns_sockets/default } startup.txt set interface state dpdk0 up set interface ip address dpdk0 192.168.0.29/24 show interface address dpdk0 插入igb_uio.ko # cd /path/to/dpdk-kmods/linux/igb_uio # insmod igb_uio.ko dpdk参数配置 # mount -t hugetlbfs nodev /mnt/huge/ # echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages 网口 # ifconfig eth0 down 启动vpp # cd /path/to/vpp # export STARTUP_CONF=/etc/vpp/startup-default.conf # make run 设置 app ns # app ns add id 123 secret 0 sw_if_index 1 if dpdk0 # show app ns 启动 vpp+iperf3+vcl # LD_PRELOAD=/home/king/share/vpp/build-root/install-vpp-native/vpp/lib/x86_64-linux-gnu/libvcl_ldpreload.so VCL_CONFIG=/etc/vpp/vcl -default.conf iperf3 -s --bind=192.168.0.29 启动 vpp + vcl + nginx # LD_PRELOAD=/home/king/share/vpp/build-root/build-vpp-native/vpp/lib/x86_64-linux-gnu/libvcl_ldpreload.so VCL_CONFIG=/etc/vpp/vcl-default.conf ./sbin/nginx -c ./conf/nginx.conf