2024-02-21 08:10 AM - edited 2024-02-21 08:11 AM
Hey,
i have ported the iperf2 example(https://github.com/STMicroelectronics/STM32CubeH5/tree/main/Projects/NUCLEO-H563ZI/Applications/NetXDuo/Nx_Iperf) of the H563 board to the H573i-DK Board.
It pretty much works as expected now, but the TX performance is a little bit poor. I expected >95Mbit/Sec for all tests. I got the following results (I ran each test about 10 times and took the average values).
- TCP TX: 85.00 Mbits/sec
- TCP RX: 93.41 Mbits/sec
- UDP TX: 95.20 Mbits/sec
- UDP RX: 99 Mbits/sec
Executed Commands on the host system (Ubuntu22.04, iperf version 2.1.5 (3 December 2021) pthreads)
- TCP TX: `iperf -s`
- TCP RX: `iperf -c 192.168.1.101`
- UDP TX: `iperf -s -u`
- UDP RX: `iperf -c 192.168.1.101 -u -b 200M`
I'm currently trying to benchmark another setup with modified ethernet settings and got even poorer results for TCP TX.
Because of that I'm wondering whats the bottleneck here. Is it the CPU?
I'd appreciate any hints or suggestions on how to find the bottleneck and improve this number.
Best,
funkii
Solved! Go to Solution.
2024-02-27 06:52 AM
Hello @funkii
Thank you for providing the project.
This is indeed a limitation in the current driver.
Could you please try this workaround:
In nx_stm32_eth_driver.c, change
if(HAL_ETH_Transmit_IT(ð_handle, &TxPacketCfg))
{
return(NX_DRIVER_ERROR);
}
To
while(HAL_ETH_Transmit_IT(ð_handle, &TxPacketCfg))
{
if(HAL_ETH_GetError(ð_handle) & HAL_ETH_ERROR_BUSY)
{
if(nx_driver_information.nx_driver_information_deferred_events &
NX_DRIVER_DEFERRED_PACKET_TRANSMITTED)
{
HAL_ETH_ReleaseTxPacket(ð_handle);
}
else
{
tx_thread_relinquish();
}
}
else
{
return(NX_DRIVER_ERROR);
}
}
Kind regards
2024-02-22 09:41 AM
Hello @funkii ,
can you provide the ported version of your firmware i'll try to investigate the issue with TCP TX .
just need more clarification about the modified Ethernet settings you tried which had poorer results :
"I'm currently trying to benchmark another setup with modified Ethernet settings and got even poorer results for TCP TX."
BR
2024-02-24 04:13 AM
Hi,
thanks for your reply.
I created a git repo with a diff file containing the relevant changes. See https://github.com/funkii7/Iperf-STM32H573I-DK.
@STea wrote:just need more clarification about the modified Ethernet settings you tried which had poorer results :
I added a sort of network filter, but currently my issue is primarily the 'poor' result without it.
I appreciate your help!
Best,
funkii
2024-02-27 06:52 AM
Hello @funkii
Thank you for providing the project.
This is indeed a limitation in the current driver.
Could you please try this workaround:
In nx_stm32_eth_driver.c, change
if(HAL_ETH_Transmit_IT(ð_handle, &TxPacketCfg))
{
return(NX_DRIVER_ERROR);
}
To
while(HAL_ETH_Transmit_IT(ð_handle, &TxPacketCfg))
{
if(HAL_ETH_GetError(ð_handle) & HAL_ETH_ERROR_BUSY)
{
if(nx_driver_information.nx_driver_information_deferred_events &
NX_DRIVER_DEFERRED_PACKET_TRANSMITTED)
{
HAL_ETH_ReleaseTxPacket(ð_handle);
}
else
{
tx_thread_relinquish();
}
}
else
{
return(NX_DRIVER_ERROR);
}
}
Kind regards
2024-02-27 07:05 AM
- TCP TX: 85.00 Mbits/sec
- TCP RX: 93.41 Mbits/sec
Not too bad for HAL, and considering that the H5 series is not as fast as H7.
Have you enabled all hardware options concerning checksums (IP, TCP)?
2024-03-01 10:18 AM
Hey,
thank you for your reply!
The fix works, the results are now as expected (I reran each test 10 times):
- TCP TX: 94.9 Mbits/Ssec
- TCP RX. 93.0 Mbits/Sec
- UDP TX: 91.2 Mbits/Sec
- UDP RX: 95.0 Mbits/Sec
Best,
funkii