Network Setup
It’s assumed that the WHLE boards are connected in the following setup:
whle_ls1026_0 | eth4 | | eth5 whle_ls1046_0 | eth4 | | eth5 whle_ls1046_1 | eth4 | | eth5 whle_ls1026_1
The whle_ls1026_0
, whle_ls1026_1
are endpoints while whle_ls1046_0
, whle_ls1046_1
are gateways.
System setup
All hosts have the same system setup.
Kernel
Make sure /etc/default/u-boot
contains kernel arguments bportals=s0 qportals=s0 iommu.passthrough=1
# cat /etc/default/u-boot
U_BOOT_UPDATE="true" U_BOOT_PARAMETERS="console=ttyS0,115200 earlycon=uart8250,mmio,0x21c0500 rootwait rw bportals=s0 qportals=s0 iommu.passthrough=1"
Install the right kernel version.
apt-get install -q0 linux-image-6.1.56-whle-ls1-sdk-ga9c58120e2b7
Make sure the installed kernel will be loaded on boot.
# cat /boot/extlinux/extlinux.conf | grep ^default
default l1
# cat /boot/extlinux/extlinux.conf | grep 'label l1$' -A 6
label l1 menu label Ubuntu 22.04 LTS 6.1.56-whle-ls1-sdk-ga9c58120e2b7 linux /boot/vmlinuz-6.1.56-whle-ls1-sdk-ga9c58120e2b7 initrd /boot/initrd.img-6.1.56-whle-ls1-sdk-ga9c58120e2b7 fdtdir /usr/lib/linux-image-6.1.56-whle-ls1-sdk-ga9c58120e2b7/ append root=UUID=4e117e32-2acc-400d-8d97-915b6c99c41e console=ttyS0,115200 earlycon=uart8250,mmio,0x21c0500 rootwait rw bportals=s0 qportals=s0 iommu.passthrough=1
Reboot the board.
Software
# apt-get install -q0 fmc iperf3 bridge-utils
FMC setup
Before any network setup run the fmc tool to set up packet queuing rules.
# fmc -c /root/fmc-config-000000.xml -p /root/fmc-policy-000000.xml -a
The files:
This configuration forms a single, core-affined queue for all traffic. In this way the performance X of a single core in the role of a router or a bridge can be isolated and measured. The performance of the whole processor depends on how evenly the traffic is distributed among the cores, which, if done properly, can easily get close to 4X in case of LS1046 or 2X in case of LS1026. How to evenly distribute the traffic with the queuing rules ultimately depends on the nature of traffic the board is supposed to forward and it’s outside of scope of this tutorial. On technical details of defining the policies please refer to https://www.nxp.com/docs/en/application-note/AN4760.pdf.
Router
Network setup
Enable routing in kernel
whle_ls1046_*:
# echo 1 > /proc/sys/net/ipv4/ip_forward
Set up the network (eth0
is assumed to be the control interface, omitted from the setup)
whle_ls1026_0
# ip address flush eth1 # ip address flush eth2 # ip address flush eth3 # ip address flush eth4 # ip address flush eth5 # ip addr add 192.168.10.1/24 dev eth4 # ip addr add 192.168.11.1/24 dev eth4 # ip link set dev eth4 up # ip link set dev eth5 up # ip route add 192.168.20.0/24 via 192.168.10.2 # ip route add 192.168.30.0/24 via 192.168.10.2 # ip route add 192.168.31.0/24 via 192.168.11.2
whle_ls1046_0
# ip address flush eth1 # ip address flush eth2 # ip address flush eth3 # ip address flush eth4 # ip address flush eth5 # ip addr add 192.168.10.2/24 dev eth5 # ip addr add 192.168.11.2/24 dev eth5 # ip addr add 192.168.20.1/24 dev eth4 # ip link set dev eth4 up # ip link set dev eth5 up # ip route add 192.168.30.0/24 via 192.168.20.2 # ip route add 192.168.31.0/24 via 192.168.20.2
whle_ls1046_1
# ip address flush eth1 # ip address flush eth2 # ip address flush eth3 # ip address flush eth4 # ip address flush eth5 # ip addr add 192.168.20.2/24 dev eth5 # ip addr add 192.168.30.1/24 dev eth4 # ip addr add 192.168.31.1/24 dev eth4 # ip link set dev eth4 up # ip link set dev eth5 up # ip route add 192.168.10.0/24 via 192.168.20.1 # ip route add 192.168.11.0/24 via 192.168.20.1
whle_ls1026_1
# ip address flush eth1 # ip address flush eth2 # ip address flush eth3 # ip address flush eth4 # ip address flush eth5 # ip addr add 192.168.30.2/24 dev eth5 # ip addr add 192.168.31.2/24 dev eth5 # ip link set dev eth4 up # ip link set dev eth5 up # ip route add 192.168.10.0/24 via 192.168.30.1 # ip route add 192.168.11.0/24 via 192.168.31.1 # ip route add 192.168.20.0/24 via 192.168.30.1
Testing
whle_ls1026_0
# iperf3 -s
whle_ls1026_1
# iperf3 -c 192.168.10.1
Connecting to host 192.168.10.1, port 5201 [ 5] local 192.168.30.2 port 35450 connected to 192.168.10.1 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 449 MBytes 3.77 Gbits/sec 0 3.16 MBytes [ 5] 1.00-2.00 sec 468 MBytes 3.92 Gbits/sec 0 3.16 MBytes [ 5] 2.00-3.00 sec 469 MBytes 3.93 Gbits/sec 0 3.16 MBytes [ 5] 3.00-4.00 sec 468 MBytes 3.93 Gbits/sec 0 3.16 MBytes [ 5] 4.00-5.00 sec 469 MBytes 3.93 Gbits/sec 0 3.16 MBytes [ 5] 5.00-6.00 sec 464 MBytes 3.89 Gbits/sec 0 3.16 MBytes [ 5] 6.00-7.00 sec 459 MBytes 3.85 Gbits/sec 0 3.16 MBytes [ 5] 7.00-8.00 sec 460 MBytes 3.86 Gbits/sec 0 3.16 MBytes [ 5] 8.00-9.00 sec 461 MBytes 3.87 Gbits/sec 0 3.16 MBytes [ 5] 9.00-10.00 sec 458 MBytes 3.84 Gbits/sec 0 3.16 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 4.51 GBytes 3.88 Gbits/sec 0 sender [ 5] 0.00-10.07 sec 4.51 GBytes 3.85 Gbits/sec receiver iperf Done.
The network speed close to 4 Gb/s is achieved on a single core in the router role, which allows LS1026 to achieve around 7 Gb/s and LS1046 to easily surpass 9 Gb/s even with sub-optimal queuing, both using standard kernel DPAA drivers.
L2 Bridge
Network setup
whle_ls1046_*
# ip address flush eth4 # ip address flush eth5 # ip link set dev eth4 down # ip link set dev eth5 down # brctl addbr br0 # brctl addif br0 eth4 # brctl addif br0 eth5 # ip link set dev br0 up # ip link set dev eth4 up # ip link set dev eth5 up
whle_ls1026_0
# ip address flush eth4 # ip address add 192.168.10.1/24 dev eth4 # ip link set dev eth4 up
whle_ls1026_1
# ip address flush eth5 # ip address add 192.168.10.2/24 dev eth5 # ip link set dev eth5 up
Testing
whle_ls1026_0
# iperf3 -s
whle_ls1026_1
# iperf3 -c 192.168.10.1
Connecting to host 192.168.10.1, port 5201 [ 5] local 192.168.10.2 port 51262 connected to 192.168.10.1 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 552 MBytes 4.62 Gbits/sec 0 3.08 MBytes [ 5] 1.00-2.00 sec 576 MBytes 4.83 Gbits/sec 263 2.25 MBytes [ 5] 2.00-3.00 sec 589 MBytes 4.94 Gbits/sec 138 1.75 MBytes [ 5] 3.00-4.00 sec 579 MBytes 4.86 Gbits/sec 0 1.97 MBytes [ 5] 4.00-5.00 sec 571 MBytes 4.79 Gbits/sec 0 2.17 MBytes [ 5] 5.00-6.00 sec 584 MBytes 4.90 Gbits/sec 0 2.36 MBytes [ 5] 6.00-7.00 sec 569 MBytes 4.77 Gbits/sec 267 1.82 MBytes [ 5] 7.00-8.00 sec 575 MBytes 4.83 Gbits/sec 0 2.04 MBytes [ 5] 8.00-9.00 sec 579 MBytes 4.86 Gbits/sec 0 2.24 MBytes [ 5] 9.00-10.00 sec 579 MBytes 4.85 Gbits/sec 0 2.42 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 5.62 GBytes 4.82 Gbits/sec 668 sender [ 5] 0.00-10.04 sec 5.62 GBytes 4.80 Gbits/sec receiver
Speed network close to 5 Gb/s is achieved on a single core, which allows for throughput close to the link speed on both LS1026 and LS1046 platforms working in a bridge mode on standard Linux DPAA drivers.
Add Comment