可怜的猪头 阅读(68) 评论(0)
https://www.cnblogs.com/dream397/p/12697629.html

绑定前网卡驱动
[root@localhost ~]# ethtool -i  enp5s0
driver: hinic
version: 
firmware-version: 
expansion-rom-version: 
bus-info: 0000:05:00.0
supports-statistics: no
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
[root@localhost ~]#
安装ovs遇到一个问题那就是ovs version和dpdk version不匹配,华为鲲鹏920上安装的dpdk是dpdk-19.11 
ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev
[root@localhost ~]# ovs-vsctl add-port br0 dpdk1 -- set Interface dpdk1 type=dpdk options:dpdk-devargs=0000:05:00.0ovs-vsctl: Error detected while setting up 'dpdk1': could not open network device dpdk1 (Address family not supported by protocol).  See ovs-vswitchd log for details.ovs-vsctl: The default log directory is "/var/log/openvswitch".[root@localhost ~]# ovs-vsctl showbb6aa323-f96b-4872-98f8-7aa87fc99958    Bridge "br0"        datapath_type: netdev        Port "dpdk1"            Interface "dpdk1"                type: dpdk                options: {dpdk-devargs="0000:05:00.0"}                error: "could not open network device dpdk1 (Address family not supported by protocol)"        Port "br0"            Interface "br0"                type: internal[root@localhost ~]#
[root@localhost dpdk-19.11]# ./usertools/dpdk-devbind.py   --status


Network devices using DPDK-compatible driver
============================================
0000:05:00.0 'Hi1822 Family (2*25GE) 0200' drv=vfio-pci unused=hinic
0000:06:00.0 'Hi1822 Family (2*25GE) 0200' drv=vfio-pci unused=hinic


Network devices using kernel driver
===================================
0000:7d:00.0 'HNS GE/10GE/25GE RDMA Network Controller a222' if=enp125s0f0 drv=hns3 unused=hns_roce_hw_v2,vfio-pci *Active*
0000:7d:00.1 'HNS GE/10GE/25GE Network Controller a221' if=enp125s0f1 drv=hns3 unused=vfio-pci 
0000:7d:00.2 'HNS GE/10GE/25GE RDMA Network Controller a222' if=enp125s0f2 drv=hns3 unused=hns_roce_hw_v2,vfio-pci 
0000:7d:00.3 'HNS GE/10GE/25GE Network Controller a221' if=enp125s0f3 drv=hns3 unused=vfio-pci 


No 'Baseband' devices detected
==============================


No 'Crypto' devices detected
============================


No 'Eventdev' devices detected
==============================


No 'Mempool' devices detected
=============================


No 'Compress' devices detected
==============================


No 'Misc (rawdev)' devices detected
===================================
[root@localhost dpdk-19.11]#
修改配置文件config/common_linuxapp,这里我们测试vhost模式,所以需要把下面两个配置项,配置为yes。




CONFIG_RTE_BUILD_COMBINE_LIBS=y
CONFIG_RTE_LIBRTE_VHOST=y
[root@localhost dpdk-19.11]# grep -n CONFIG_RTE_LIBRTE_VHOST config/common_base 1030:CONFIG_RTE_LIBRTE_VHOST=y1031:CONFIG_RTE_LIBRTE_VHOST_NUMA=n1032:CONFIG_RTE_LIBRTE_VHOST_DEBUG=n

[root@localhost dpdk-19.11]# mkdir -p /usr/src/dpdk
[root@localhost dpdk-19.11]# make install T=arm64-armv8a-linuxapp-gcc  DESTDIR=/usr/src/dpdk -j 64将dpdk安装到当前系统make install T=arm64-armv8a-linuxapp-gcc  DESTDIR=/usr -j 64安装完成后可以使用dpdk的命令了
[root@localhost ~]# dpdk-devbind --status


Network devices using DPDK-compatible driver============================================0000:05:00.0 'Hi1822 Family (2*25GE) 0200' drv=vfio-pci unused=hinic0000:06:00.0 'Hi1822 Family (2*25GE) 0200' drv=vfio-pci unused=hinic


Network devices using kernel driver===================================0000:7d:00.0 'HNS GE/10GE/25GE RDMA Network Controller a222' if=enp125s0f0 drv=hns3 unused=hns_roce_hw_v2,vfio-pci *Active*0000:7d:00.1 'HNS GE/10GE/25GE Network Controller a221' if=enp125s0f1 drv=hns3 unused=vfio-pci 0000:7d:00.2 'HNS GE/10GE/25GE RDMA Network Controller a222' if=enp125s0f2 drv=hns3 unused=hns_roce_hw_v2,vfio-pci 0000:7d:00.3 'HNS GE/10GE/25GE Network Controller a221' if=enp125s0f3 drv=hns3 unused=vfio-pci 


No 'Baseband' devices detected==============================


No 'Crypto' devices detected============================


No 'Eventdev' devices detected==============================


No 'Mempool' devices detected=============================


No 'Compress' devices detected==============================


No 'Misc (rawdev)' devices detected===================================
 
[root@localhost ~]# cd /usr/[root@localhost usr]# find ./ -name dpdk*./sbin/dpdk-devbind./bin/dpdk-test-compress-perf./bin/dpdk-pdump./bin/dpdk-test-crypto-perf./bin/dpdk-pmdinfo./bin/dpdk-test-eventdev./bin/dpdk-procinfo./src/dpdk./src/dpdk/sbin/dpdk-devbind./src/dpdk/bin/dpdk-test-compress-perf./src/dpdk/bin/dpdk-pdump./src/dpdk/bin/dpdk-test-crypto-perf./src/dpdk/bin/dpdk-pmdinfo./src/dpdk/bin/dpdk-test-eventdev./src/dpdk/bin/dpdk-procinfo./src/dpdk/lib/modules/4.14.0-115.el7a.0.1.aarch64/extra/dpdk./src/dpdk/include/dpdk./src/dpdk/share/dpdk./src/dpdk/share/dpdk/usertools/dpdk-pmdinfo.py./src/dpdk/share/dpdk/usertools/dpdk-devbind.py./src/dpdk/share/dpdk/usertools/dpdk-telemetry-client.py./src/dpdk/share/dpdk/usertools/dpdk-setup.sh./src/dpdk/share/dpdk/arm64-armv8a-linuxapp-gcc/app/dpdk-pmdinfogen./lib/modules/4.14.0-115.el7a.0.1.aarch64/extra/dpdk./include/dpdk./share/dpdk./share/dpdk/usertools/dpdk-pmdinfo.py./share/dpdk/usertools/dpdk-devbind.py./share/dpdk/usertools/dpdk-telemetry-client.py./share/dpdk/usertools/dpdk-setup.sh./share/dpdk/arm64-armv8a-linuxapp-gcc/app/dpdk-pmdinfogen[root@localhost usr]# dpdk-devbind  -u  0000:05:00.0 0000:06:00.0

[root@localhost openvswitch-2.12.0]# ls
acinclude.m4  config.log        Documentation    Makefile     ovsdb       tests                windows
aclocal.m4    config.status     include          Makefile.am  package.m4  third-party          xenserver
appveyor.yml  configure         ipsec            Makefile.in  poc         tutorial
AUTHORS.rst   configure.ac      lib              manpages.mk  python      utilities
boot.sh       CONTRIBUTING.rst  libtool          NEWS         README.rst  Vagrantfile
build-aux     datapath          LICENSE          NOTICE       rhel        Vagrantfile-FreeBSD
config.h      datapath-windows  m4               ofproto      selinux     vswitchd
config.h.in   debian            MAINTAINERS.rst  ovn          stamp-h1    vtep
[root@localhost openvswitch-2.12.0]# ./configure --with-dpdk=/usr/src/dpdk --prefix=/usr --sysconfdir=/etc --localstatedir=/var
===========================================================