部署DPDK和OVS
DPDK(Data Plane Development Kit)通过在用户态加速OVS(Open vSwitch)的流表处理。DPDK采用轮询模式驱动,直接与用户态应用进行交互,有效减少了内核态与用户态之间的上下文切换、系统调用的次数以及内存拷贝的开销,降低了CPU的利用率,从而提升了网络性能。
以下为DPDK和OVS的安装步骤,包括系统依赖和Python依赖的安装、DPDK的源码编译安装以及OVS的配置、编译和安装过程。
- 安装依赖包。
yum -y install meson ninja-build gcc make python3-pyelftools kernel-devel-$(uname -r) kernel-headers-$(uname -r) numactl-devel libpcap-devel rdma-core-devel libbpf-devel libbpf groff-base python3-six openssl-devel autoconf automake libtool unbound-devel python3-devel
- 安装DPDK。
wget http://fast.dpdk.org/rel/dpdk-21.11.tar.xz --no-check-certificate tar -xvf dpdk-21.11.tar.xz cd dpdk-21.11/ meson --prefix=/usr --libdir=/usr/lib64 --bindir=/usr/bin --sbindir=/usr/sbin --includedir=/usr/include/dpdk -Dc_args="-O0 -g -fstack-protector-strong" -Dc_link_args="-g -Wl,-z,relro,-z,now,-z,noexecstack" -Denable_kmods=true build ninja -C build && ninja -C build install && ldconfig
- 安装OVS。
wget https://www.openvswitch.org/releases/openvswitch-2.17.2.tar.gz --no-check-certificate tar -xvf openvswitch-2.17.2.tar.gz cd openvswitch-2.17.2/ ./boot.sh ./configure CFLAGS="-march=armv8-a+lse+crc -fstack-protector-all -fstack-protector-strong " --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/lib64 --enable-ssl --enable-shared --with-dpdk=shared make -j`nproc` make -j`nproc` install cp rhel/etc_init.d_openvswitch /etc/init.d/openvswitch chmod +x /etc/init.d/openvswitch
父主题: 虚拟机网络调优