---
title: 部署DPDK和OVS
description: "DPDK（Data Plane Development Kit）通过在用户态加速OVS（Open vSwitch）的流表处理。DPDK采用轮询模式驱动，直接与用户态应用进行交互，有效减少了内核态与用户态之间的上下文切换、系统调用的次数以及内存拷贝的开销，降低了CPU的使用率，从而提升了网络性能。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengcpfs/systuningguide/systemtg/kunpengtypical_05_0009.html
sourcePath: /source/zh/kunpengcpfs/systuningguide/systemtg/kunpengtypical_05_0009.html
indexId: 740e282956122f99cb5909f37301557b7a4fc0da363356ae98ebf215c89918fa74
---
# 部署DPDK和OVS

DPDK（Data Plane Development Kit）通过在用户态加速OVS（Open vSwitch）的流表处理。DPDK采用轮询模式驱动，直接与用户态应用进行交互，有效减少了内核态与用户态之间的上下文切换、系统调用的次数以及内存拷贝的开销，降低了CPU的使用率，从而提升了网络性能。

以下为DPDK和OVS的安装步骤，包括系统依赖和Python依赖的安装、DPDK的源码编译安装以及OVS的配置、编译和安装过程。

1. 安装依赖包。

```
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
```


2. 安装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 build
ninja -C build && ninja -C build install && ldconfig
```


3. 安装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 --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
```
