LS1043A(Ubuntu)编译安装并使用DPAA
一、DPAA简介
DPAA全称为Data Path Acceleration Architecture,是一种用于网络处理的硬件架构,由芯片制造商Freescale提出并推广。DPAA旨在提高网络数据包处理的效率和吞吐量,并减小CPU的负载。DPAA架构中包含了多个处理单元和加速器,能够支持各种网络协议和数据包格式,如IPv4、IPv6、TCP、UDP等。
DPAA的主要特点包括:
- 支持多种协议和数据包格式
- 多个处理单元和加速器并行处理数据包
- 通过DMA技术实现高效的数据包传输
- 支持硬件加速的安全功能,如IPsec和SSL/TLS
- 提供软件开发工具和API,方便开发人员使用和定制
以下是一些DPAA相关的链接:
- DPAA开发者指南: https://www.nxp.com/docs/en/supporting-information/QORIQ-SDK-2.0-IC-REV0.pdf
- Freescale官网DPAA介绍: https://www.nxp.com/products/processors-and-microcontrollers/power-architecture-processors/qoriq-platforms/data-path-acceleration-architecture-dpaa:DPAA
- DPAA在Linux内核中的实现: https://www.kernel.org/doc/Documentation/networking/fsl-dpaa.txt
- Layerscape软件开发工具包用户指南,适用于Yocto: https://docs.nxp.com/bundle/GUID-E5527A77-2F97-4244-BF9C-D08F068EFD16/page/GUID-259A597C-A9CF-49B0-8F6E-91BF558D1B73.html
二、LS1043A在Ubuntu编译安装DPAA
1、创建DPDK文件夹,将DPDK源码下载到该位置并解压
root@localhost:~# mkdir dpdk root@localhost:~# cd dpdk/
root@localhost:~/dpdk# wget http://fast.dpdk.org/rel/dpdk-19.11.14.tar.xz
root@localhost:~/dpdk# ls dpdk-19.11.14.tar.xz root@localhost:~/dpdk# tar -xvf dpdk-19.11.14.tar.xz
2、编译安装DPAA,编译示例程序
root@localhost:~/dpdk# cd dpdk-stable-19.11.14/ root@localhost:~/dpdk/dpdk-stable-19.11.14# make T=arm64-dpaa-linuxapp-gcc install CONFIG_RTE_KNI_KMOD=n CONFIG_RTE_EAL_IGB_UIO=n -j 4
root@localhost:~/dpdk/dpdk-stable-19.11.14# pwd /root/dpdk/dpdk-stable-19.11.14 root@localhost:~/dpdk/dpdk-stable-19.11.14# export RTE_SDK=/root/dpdk/dpdk-stable-19.11.14 root@localhost:~/dpdk/dpdk-stable-19.11.14# export RTE_TARGET=arm64-dpaa-linuxapp-gcc
root@localhost:~/dpdk/dpdk-stable-19.11.14# make -C examples/l2fwd
root@localhost:~/dpdk/dpdk-stable-19.11.14# make -C examples/l3fwd
三、DPAA操作命令
1、在设备上使用DPAA时需要加载带DPAA的设备树,并使用DPDK的启动脚本或者启动参数
使用DPDK的启动脚本后,重启进入 Linux 系统,ifconfig -a 应查看不到 DPDK 所使用的网口;目前 DPDK 支持 4 种配置:ls1043/ls1043_offload/ls1046/ls1046_offload,应根据实际情况设置环境变量 USDPAA_CONFIG。
以 ls1043 为例,在 Linux Shell 中输入:
export USDPAA_CONFIG=ls1043 && source /usr/local/bin/dpdk_init.sh
运行环境准备完毕,可使用DPDK进行二层/三层转发测试
2、DPAA使用命令范例
二层转发测试:
ls1043a 网口 | 命令 | 附注 |
---|---|---|
eth0<-->eth1 | l2fwd -c 0x6 -n 1 -- -p 0x3 -q 1 -T 0 --no-mac-updating | |
eth2<-->eth3 | l2fwd -c 0x6 -n 1 -- -p 0xc -q 1 -T 0 --no-mac-updating | |
eth4<-->eth5 | l2fwd -c 0x6 -n 1 -- -p 0x30 -q 1 -T 0 --no-mac-updating | |
eth0<-->eth1 eth2<-->eth3 | l2fwd -c 0xf -n 1 -- -p 0xf -q 1 -T 0 --no-mac-updating | |
eth0<-->eth1 eth2<-->eth3 eth4<-->eth5 | l2fwd -c 0xf -n 3 -- -p 0x3f -q 1 -T 0 --no-mac-updating |
三层转发测试:
ls1043a 网口 | 命令 | 附注 |
---|---|---|
eth0<-->eth1 | l3fwd -c 0x6 -n 1 -- -p 0x3 --config="(0,0,1),(1,0,2)" -P | |
eth2<-->eth3 | l3fwd -c 0x6 -n 1 -- -p 0xc --config="(2,0,1),(3,0,2)" -P | |
eth4<-->eth5 | l3fwd -c 0x6 -n 1 -- -p 0x30 --config="(4,0,1),(5,0,2)" -P | |
eth0<-->eth1 eth2 <-->eth3 | l3fwd -c 0xf -n 1 -- -p 0xf --config="(0,0,1),(1,0,2),(2,0,1),(3,0,2)" -P | |
eth0<-->eth1 eth2<-->eth3 eth4 <-->eth5 | l3fwd -c 0xf -n 1 -- -p 0x3f --config="(0,0,1),(1,0,2),(2,0,1),(3,0,2),(4,0,1),(5,0,2)" -P |
testpmd测试:
ls1043a 网口 | 命令 | 附注 |
---|---|---|
eth0 <-->eth1 eth2<-->eth3 eth4<-->eth5 | ./testpmd -l 0-3 -n 4 -- -i |
|