原型验证目标
在一体机1.0场景下,构造ovs+xdp转发面环境,与当前版本模型普通内核态ovs及规划模型ovs+dpdk性能/资源消耗进行比较,输出最优方案
原型验证环境信息
系统版本信息:
[root@YTJ-10e101e8e11 ~]# uname -a
Linux YTJ-10e101e8e11 4.19.90-2102.2.0.0062.ctl2.x86_64 #1 SMP Thu Mar 10 03:34:36 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
ovs版本信息:
[root@YTJ-10e101e8e11 ~]# ovs-appctl version
ovs-vswitchd (Open vSwitch) 2.14.1.6
官网参考文档
https://docs.openvswitch.org/en/latest/intro/install/general/
https://docs.openvswitch.org/en/latest/intro/install/afxdp/
代码库 url:https://github.com/openvswitch/ovs.git
分支:v2.14.10
编译依赖(Build Requirements)
GNU make: make-4.3-1.ctl2.x86_64
GCC 4.6 or later: gcc-7.3.0-20190804.35.ctl2.x86_64
ibssl, from OpenSSL:
openssl-pkcs11-0.4.10-1.ctl2.x86_64
openssl-libs-1.1.1f-1.ctl2.x86_64
openssl-1.1.1f-1.ctl2.x86_64 l
ibcap-ng, written by Steve Grubb, is optional but recommended:
libcap-2.32-1.ctl2.x86_64
libcap-ng-0.7.10-1.ctl2.x86_64
Python 3.4 or later.
Python 3.7.9 (default, Jun 21 2021, 10:23:25)
[GCC 7.3.0] on linux
Unbound library:
unbound-1.11.0-1.ctl2.x86_64
unbound-libs-1.11.0-1.ctl2.x86_64
For optional support of ingress policing, you must enable kernel configuration options NET_CLS_BASIC, NET_SCH_INGRESS, and NET_ACT_POLICE, either built-in or as modules. NET_CLS_POLICE is obsolete and not needed.)
个人理解可开可不开,用于入口限速不影响原型验证,当前物理节点操作系统已经打开:
To use Open vSwitch support for TAP devices, you must enable CONFIG_TUN.
To build a kernel module, you need the same version of GCC that was used to build that kernel. If you are working from a Git tree or snapshot (instead of from a distribution tarball), or if you modify the Open vSwitch build system or the database schema, you will also need the following software: Autoconf version 2.63 or later. Automake version 1.10 or later libtool version 2.4 or later. (Older versions might work too.) 个人感觉没有必要安装,但是环境中已经具备:
The datapath tests for userspace and Linux datapaths also rely upon: pyftpdlib. Version 1.2.0 is known to work. Earlier versions should also work. GNU wget. Version 1.16 is known to work. Earlier versions should also work. netcat. Several common implementations are known to work. curl. Version 7.47.0 is known to work. Earlier versions should also work. tftpy. Version 0.6.2 is known to work. Earlier versions should also work. netstat. Available from various distro specific packages 数据面测试使用,个人觉得没有必要安装,pyftpdlib/netcat/tftpy物理节点操作系统未装包
If you are going to extensively modify Open vSwitch, consider installing the following to obtain better warnings: “sparse” version 0.6.2 or later (https://git.kernel.org/pub/scm/devel/sparse/sparse.git/). GNU make. clang, version 3.4 or later flake8 along with the hacking flake8 plugin (for Python code). The automatic flake8 check that runs against Python code has some warnings enabled that come from the “hacking” flake8 plugin. If it’s not installed, the warnings just won’t occur until it’s run on a system with “hacking” installed. the python packages listed in “python/test_requirements.txt” (compatible with pip). If they are installed, the pytest-based Python unit tests will be run. 需要大规模的修改ovs代码,有必要安装一些编译告警工具,当前预研场景不需要
building Open vSwitch with AF_XDP will require the following: libbpf and libxdp (if version of libbpf if higher than 0.6). Linux kernel XDP support, with the following options (required) CONFIG_BPF=y/CONFIG_BPF_SYSCALL=y/CONFIG_XDP_SOCKETS=y The following optional Kconfig options are also recommended, but not required: CONFIG_BPF_JIT=y (Performance)/CONFIG_HAVE_BPF_JIT=y (Performance)/CONFIG_XDP_SOCKETS_DIAG=y (Debugging) If you’re building your own kernel, be sure that you’re installing kernel headers too. For example, with the following command: make headers_install INSTALL_HDR_PATH=/usr CONFIG_HAVE_BPF_JIT / CONFIG_XDP_SOCKETS_DIAG和性能及调试相关的开关未打开 暂不影响
安装libbpf
yum -y install bpftool.x86_64
yum -y install libbpf.x86_64
yum -y install libbpf-devel.x86_64(使用ctyun2新版本进行安装,libbpf自携带)
安装libxdp
dos2unix ctyun未安装
clang未安装
llc未安装
clang及llvm的版本不够,源代码安装
clang11:https://blog.csdn.net/DunkyZ/article/details/128429869
llvm工具库(11.0.0):https://releases.llvm.org/download.html
bpftool doesn't support skeleton generation 当前版本bpftool不支持bpftool gen暂时将检查关闭