Last week we looked at our custom Kria carrier card and one of the final tests was to program the clocks using the Skyworks programmer which provides the reference clock for the Ethernet and USB. This worked as expected and I had Ethernet up and running with a little device tree and kernel driver configuration.
The next stage is to test the performance of the interface using a bench marking tool such as iPerf. We have used a Marvel Alaska 88E1510 and as a result, should be able to auto negotiate a speed of 10/100/1000 Mbps.
iPerf uses a client and server running simultaneously to test the bandwidth between two systems over an IP network. iPerf provides us the bandwidth bidirectionally between the client and server rather nicely. Advanced features also mean that we are able to examine packet loss, delay, and jitter.
However, since we are running the test between the carrier card and a development PC, we want to first make sure the network is as good as can be. Otherwise, if we have something incorrectly configured, we will see a reduced performance which is not really representative of the performance of the board.
To get the best performance figures, we need to ensure the client and server are directly connected via a single router. I ensured that each of the connections from the router prior to the testing was running at 1000 Mbps.
When I initially experimented with the bandwidth test with several switches involved, the expected bandwidth was considerably reduced because one was running at a reduced rate due to a cabling issue.
I used a x86 Linux box for the client machine and loaded iPerf3 using the command
sudo apt install iperf3
If you are using a different machine, you can download iPerf from the downloads website.
The next step is to install iPerf on the PetaLinux image running on the K26. To do this we need to include the right PetaLinux package group in the roofs configuration.
To find the right PetaLinux package group to install, we are going to look at the AMD Atlassian page on the PetaLinux package groups. We are going to install the networking stack which includes the iPerf tool chains from the package groups.
Once the package group is installed, we need to rebuild the project and transfer the updated image to the SD Card and boot the board.
We should verify the speed of the connection before we run the test although we can tell from the LED colors on the RJ45 connector. There are also better ways to confirm the speed. The method I prefer is to change directory into the Ethernet class under system and view the reported speed using the command
cat /sys/class/net/eth0/speed
This is helpful because I first tried this test just on my desk before I set it properly to check that the PetaLinux image etc. had everything it needed. I saw that the speed was 1000 but the throughput was appalling due to a 100 Mbps connection between two network switches (as seen in the image below). Normally this would not have mattered because it’s used for simple links etc. but it does in fact matter for this test.
With the custom K26 board connected to the same router as the x86 machine, we can start the test.
Determine the IP address using the ifconfig using the terminal on the K26 board and then use the command iperf3 -s which will start the server listening.
We need to run the command iperf3 -c <ip address> to complete the test on the x86. This will start the test which will transfer data bidirectionally between the client and server. After a few seconds of transfer, the test will complete and the results will be presented.
When the test was run, we observed that the bandwidth was 935 Mbps at the sender and 933 Mbps at the receiver. This is not bad performance considering the maximum theoretical performance for the 1G Ethernet is around 943 Mbps due to the interpacket gaps and protocol overhead.
For the time being, I think we can say that the Ethernet is working OK on the custom board and now we know how to test the performance and fault find the issue.
Workshops and Webinars
If you enjoyed the blog why not take a look at the free webinars, workshops and training courses we have created over the years. Highlights include
Professional PYNQ Learn how to use PYNQ in your developments
Introduction to Vivado learn how to use AMD Vivado
Ultra96, MiniZed & ZU1 three day course looking at HW, SW and Petalinux
Arty Z7-20 Class looking at HW, SW and Petalinux
Mastering MicroBlaze learn how to create MicroBlaze solutions
HLS Hero Workshop learn how to create High Level Synthesis based solutions
Perfecting Petalinux learn how to create and work with PetaLinux OS
Embedded System Book
Do you want to know more about designing embedded systems from scratch? Check out our book on creating embedded systems. This book will walk you through all the stages of requirements, architecture, component selection, schematics, layout, and FPGA / software design. We designed and manufactured the board at the heart of the book! The schematics and layout are available in Altium here Learn more about the board (see previous blogs on Bring up, DDR validation, USB, Sensors) and view the schematics here.
Sponsored by AMD