The Linux software reference environment for SoC FPGAs (Golden Software Reference Design (GSRD)) comes with ethtool installed from the start, so you can easily check the effect of changing parameters by entering the ethtool command in the terminal. Reference Design (GSRD) for SoC FPGAs comes with ethtool installed from the beginning, so you can easily check the effect of parameter changes by entering the ethtool command in the terminal.
This article describes how to change parameters using ethtool and the results of experiments on Ethernet performance changes.
The experiment was conducted with the following device configuration:
The Ethernet of two evaluation boards with Cyclone V SoC is directly connected with one LAN cable. The configuration was such that the network was not affected by other devices in the network. For the specifications of the evaluation board used, Atlas-SoC Development Platform (Terasic DE0-Nano-SoC), please refer to the relevant board's page on Rocketboards.org (link below).
Atlas-SoC Development Platform
Figure 1. Environment used for this verification (network connection)
How to change parameters using ethtool
The ethtool is used by entering the command "ethtool" on a Linux UART terminal.
Parameters related to the operation of the Ethernet driver can be "displayed" by specifying the -c (lowercase) option on the command line, and "changed" by specifying the -C (uppercase) option. (The parameters handled by the -c / -C option are called coalesce parameters.)
The following two command lines are used in this experiment.
- Show coalesce parameters (specify -c (lowercase))
"ethtool -c <network device name>" (e.g. ethtool -c eth0) - Change coalesce parameter (specify -C (uppercase))
"ethtool -C <network device name> <parameter name> <set value>" (e.g. ethtool -C eth0 rx-usecs 40)
For other operations, refer to the help screen displayed by "ethtool --help".
Among the coalesce parameters, the following parameters seem to be related to network performance.
- rx-usecs ... Delay time (usec) from packet arrival to issuance of receive interrupt
- tx-usecs ... Delay time (usec) from packet transmission to issuance of send interrupt
- tx-frames ... Maximum number of packets sent before a send interrupt is issued
The above parameters are also edited in the experiments in this article. Experiments were conducted in an environment with two patterns of parameter changes (configuration change 1 and configuration change 2) in addition to the initial set values (before the changes). In this case, the same settings were made on both of the two evaluation boards for both the Change 1 and Change 2 parameter changes. The rx-usecs setting seemed to have a lower limit, but it was possible to set a smaller value by changing the driver source code. (This was done in Configuration Change 2)
The specific parameter setting values and driver modification points are shown in the figure below.
Figure 2. Default values of ethtool coalesce parameters and changes made
Experimental Results
Ping Response
The response time (time= XXX ms) displayed when executing the ping command was compared, and it appears that the rx-usecs setting has a significant effect on the ping response.
We also tried changing the delay settings (tx-usecs, tx-frames) on the sender side, but the response time did not change significantly even after changing the parameters on the sender side.
Figure 3. Comparison of ping responses
iperf Throughput
We also compared the throughput measurement results using iperf. iperf, like ethtool, is software that must be installed separately, but since it is installed from the beginning in the Linux software reference environment for SoC FPGAs, it can be used as is. The results of iperf show that the piperf is not a problem.
The iperf results did not show a clear trend like the ping response time, but the maximum throughput was affected not only by rx-usecs but also by the delay setting on the sender side.
Change 1 (reducing only rx-usecs from the default value) improved throughput for a given packet size, but Change 2 (minimizing rx-usecs and changing the sender delay setting to a smaller value) resulted in a decrease in throughput. This is probably due to the fact that the sender's delay setting is set to a smaller value. This is probably due to the effect of changing the delay setting on the sender side to a smaller value.
Figure 4. Comparison of iperf throughput
Conclusion
From the results of the experiment, it was confirmed that the ping response time and iperf results can be significantly changed by changing the setting value of the ethtool coalesce parameter. This suggests that the use of ethtool (changing the coalesce parameter setting) can be an effective means of Ethernet performance tuning when such tuning is required.
If the delay time or throughput of Ethernet packet transmission/reception does not meet the expected performance, first try tuning the coalesce parameter using ethtool.
Finally, please note the following when using ethtool to change the coalesce parameter settings.
Note:
rx-usecs, tx-usecs, and other settings have the role of providing some delay time for the Ethernet driver to send and receive packets so that sending and receiving packets does not adversely affect the overall performance of the Linux system. If the coalesce parameter is changed to minimize the delay time, the frequency of send/receive interrupts will increase, so the optimal value should be determined after considering the impact on other processes (the entire Linux system).