一、前言
根据文章《DPDK系列之六:qemu-kvm网络后端的加速技术》,OVS-DPDK可以给虚拟机的部署密度和虚拟机网络性能的提升带来帮助。本文将介绍如何编译和安装DPDK以及如何使用DPDK提升网络性能:
- OS:CentOS 7.4.1708
- OVS:2.8.1
- DPDK:17.08.1
转载自https://blog.csdn.net/cloudvtech
二、操作系统和DPDK的安装
2.1 系统配置
硬件
1 NUMA node with 4 CPU cores
8 GB memory
3 NICs
40 GB disk
操作系统
cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
[root@ovs-dpdk ~]# uname -a
Linux ovs-dpdk 3.10.0-693.11.1.el7.x86_64 #1 SMP Mon Dec 4 23:52:40 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
2.2 安装基础依赖软件包
yum makecache
yum -y update
yum install -y epel-release
yum install -y net-tools tcpdump telnet wget zip unzip vim
yum install -y gcc gcc-c++ kernel-devel kernel-headers kernel.x86_64 net-tools
yum install -y numactl-devel.x86_64 numactl-libs.x86_64
yum install -y libpcap.x86_64 libpcap-devel.x86_64
yum install -y pciutils
yum install -y autoconf automake libtool
2.3 编译DPDK
wget http://fast.dpdk.org/rel/dpdk-17.08.1.tar.xz
tar -xvf dpdk-17.08.1.tar
cd dpdk-stable-17.08.1/
patch lib/librte_eal/linuxapp/igb_uio/igb_uio.c
export RTE_SDK=/root/dpdk-stable-17.08.1
export RTE_TARGET=x86_64-native-linuxapp-gcc
make config T=x86_64-native-linuxapp-gcc
sed -ri 's,(PMD_PCAP=).*,\1y,' build/.config
add in config/common_linuxapp : CONFIG_RTE_BUILD_COMBINE_LIBS=y
make
cd $RTE_SDK
make install T=x86_64-native-linuxapp-gcc
绑定网卡
ifconfig ens38 down
modprobe uio_pci_generic
modprobe uio
insmod /root/dpdk-stable-17.08.1/build/