前置
公司需要高性能网关转发设备,于是开始调研。
经推荐,VPP是个高性能处理包,且提供了不少开箱即用的功能。
安装(非源码方式)
版本
Ubuntu 18.04
更新apt-get源
本次采用二进制安装,具体见 https://fd.io/docs/vpp/master/gettingstarted/installing/ubuntu.html
官方也提供了更简单的安装脚本(自动设置好源之类的东西),见 https://packagecloud.io/fdio/release/install
curl -s https://packagecloud.io/install/repositories/fdio/release/script.deb.sh | sudo bash
or
apt-get update
vim /etc/apt/sources.list.d/99fd.io.list
# write to
deb [trusted=yes] https://packagecloud.io/fdio/release/ubuntu bionic main
# get key
curl -L https://packagecloud.io/fdio/release/gpgkey | sudo apt-key add -
安装软件
必须安装
sudo apt-get update
sudo apt-get install vpp vpp-plugin-core vpp-plugin-dpdk
可选安装
sudo apt-get install vpp-api-python python3-vpp-api vpp-dbg vpp-dev
修改service
cat /lib/systemd/system/vpp.service
ExecStartPre=-/sbin/modprobe uio_pci_generic
变为
ExecStartPre=-/sbin/modprobe vfio-pci
从文件启动
加上startup-config
unix {
nodaemon
log /var/log/vpp/vpp.log
full-coredump
cli-listen /run/vpp/cli.sock
startup-config /etc/vpp/up.txt
gid vpp
}
打开dpdk
这里使用vfio-pci
# 注意, vmxnet3类型的只能使用vfio-pci,且不要在配置文件里接管接口
卸载
sudo apt-get remove --purge vpp*
验证
cli
root@10-255-20-82:/home/dc2-user# vppctl
_______ _ _ _____ ___
__/ __/ _ \ (_)__ | | / / _ \/ _ \
_/ _// // / / / _ \ | |/ / ___/ ___/
/_/ /____(_)_/\___/ |___/_/ /_/
vpp# show version
vpp v20.01-release built by root on 4d189446a03d at 2020-01-29T22:12:33
vpp#
adjacency api app bfd bier binary-api bond bvi cj
classify clear configure cop create delete disable elog enable
event-logger exec gpe history interface ip6 ipfix ipsec ip
l2fib l2 lisp loopback memory-trace mpls one p2p_ethernet packet-generator
pcap pipe punt qos quit q renumber restart session
set show sr suspend tcp test trace udp wait
vpp# q
root@10-255-20-82:/home/dc2-user#
进程
root@10-255-20-82:/home/dc2-user# ps aux | grep vpp
root 17842 0.0 0.0 16300 964 pts/0 S+ 16:29 0:00 grep --color=auto vpp
root 31795 1.7 0.4 18141108 18844 ? Ss Jul27 72:36 /usr/bin/vpp -c /etc/vpp/startup.conf
root@10-255-20-82:/home/dc2-user#
来源:oschina
链接:https://my.oschina.net/u/914655/blog/4456602