========================编译安装===============================
编译安装 参考http://blog.csdn.net/icebluechao/article/details/51208560
编译安装运行参考http://blog.csdn.net/shaoyunzhe/article/details/53096932
1、 下载代码: gitclone
2、 进入目录并且安装: cd vpp; make install-dep;
3、 生成Makefile: cd vpp/build-root;make distclean;./bootstrap.sh;
4、 进行编译:make V=0 PLATFORM=vpp TAG=vpp install-rpm;或者make V=0 PLATFORM=vpp TAG=vpp install-deb;
5、 包安装:rpm –ivh*.rpm或者dpkg –i *.deb
编译成功后vpp位置: vpp/build-root/install-vpp-native/vpp/bin/vpp
========================运行准备===============================
插入uio模块 modprobe uio
插入igb_uio模块 insmod /home/lwh/vpp/build-root/rpm/vpp-17.01/build-root/install-vpp-native/dpdk/build/lib/librte_eal/linuxapp/igb_uio/igb_uio.ko
设置大页
mkdir /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
设置大页数目 echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
查看大页分配数目 cat /proc/meminfo| grep Huge
查看网卡pci号,并绑定绑卡驱动为igb_uio
cd /home/lwh/vpp/build-root/build-vpp-native/dpdk/dpdk-16.07/tools/
查看网卡使用驱动状态 ./dpdk-devbind.py --status
解除网卡的驱动 ./dpdk-devbind.py -u 0000:06:00.0
加载igb_uio驱动到网卡 ./dpdk-devbind.py --bind=igb_uio 0000:06:00.0
编辑配置文件/etc/vpp/startup.conf内容如下
##################/etc/vpp/startup.conf start#####################
#参考网站
#参考代码中自带的 startup.conf 文件中的解释说明
unix {
#交互模式
interactive
#使用telnet 127.0.0.1 5002访问
cli-listen 127.0.0.1:5002
log /tmp/vpp.log
full-coredump
}
cpu {
#主线程运行在0核
main-core 0
#工作线程运行的cpu 16位掩码
coremask-workers 2
}
dpdk {
#使用的驱动
uio-driver igb_uio
#使用的dev 及队列数
dev 0000:05:00.0 {num-rx-queues 2}
dev 0000:05:00.1 {num-rx-queues 2}
num-mbufs 65536
socket-mem 1024
}
api-trace {
on
}
api-segment {
gid vpp
}
###########################/etc/vpp/startup.conf end########################################
========================运行vpp===============================
开启vpp systemctl start vpp.service
关闭vpp systemctl stop vpp.service
查看vpp状态 systemctl status vpp.service
vpp基本命令
交互模式
连接vpp telnet 127.0.0.1 5002
show interface
show ip arp
show ip fib
show error
clear run
show run
set int state GigabitEthernet6/0/0 up
set int ip address GigabitEthernet6/0/0 X.X.X.X/24
show threads
show dpdk interface placement
set interface l2 bridge GigabitEthernet6/0/0 1
非交互模式
vppctl show interface
vppctl show ip arp
vppctl show ip fib
vppctl show error
vppctl clear run
vppctl show run
vppctl set int state GigabitEthernet6/0/0 up
vppctl set int ip address GigabitEthernet6/0/0 X.X.X.X/24
vppctl show threads
vppctl show dpdk interface placement
vppctl set interface l2 bridge GigabitEthernet6/0/0 1
命令行参考
(CLI)_Guide
阅读(7111) | 评论(0) | 转发(0) |