Skip to content

Conversation

Freey0
Copy link
Contributor

@Freey0 Freey0 commented Aug 1, 2025

Enable TX transmission asynchronous mode to enhance performance

Tested on the nucleo_h743zi board using samples/net/zperf

west build -b nucleo_h743zi/stm32h743xx samples/net/zperf/ --pristine
-- -DCONFIG_NET_CONFIG_MY_IPV4_ADDR=\"192.168.1.199\"

upload cmd:
```
//linux
iperf -s -l 1K -p 5001
iperf -s -l 1K -p 5002 -u

//shell
zperf tcp upload 192.168.1.109 5001 10 1K
zperf udp upload 192.168.1.109 5002 10 1K 300M
```

download cmd:
```
//shell
zperf tcp download 5001 192.168.1.199
zperf ucp download 5002 192.168.1.199

//linux
iperf -l 1K -c 192.168.1.199 -p 5001
iperf -l 1K -c 192.168.1.199 -p 5002 -u
```

@Freey0
Copy link
Contributor Author

Freey0 commented Aug 1, 2025

After adding the configuration, the performance has approached the level of other RTOS.

# For TCP
CONFIG_PICOLIBC_USE_MODULE=y
CONFIG_ETH_STM32_HW_CHECKSUM=y

#For UDP
CONFIG_NET_ZPERF_MAX_PACKET_SIZE=1470

udp upload: 94.1Mbps/s
tcp upload: 92.9Mbps/s
udp download: 95.6Mbps/s
tcp download: 94.5Mbps/s

@Freey0 Freey0 force-pushed the eth_stm32_async_impl branch from 2922b5c to 965f601 Compare August 2, 2025 06:17
Copy link

sonarqubecloud bot commented Aug 2, 2025

Freey0 added a commit to Freey0/zephyr that referenced this pull request Aug 23, 2025
For TCP, CONFIG_PICOLIBC_USE_MODULE=y has a significant impact
on performance.

Use nucleo_h743zi board with loopback:
```
before:
tcp upload: 49.35 Mbps/s

after:
tcp upload: 56.52 Mbps/s
```

Use nucleo_h743zi board, default config:
```
before:
tcp upload: 71.3Mbps/s
tcp download: 75.11 Mbps/s

after:
tcp upload: 75.3Mbps/s
tcp download: 94.39 Mbps/s
```

Use nucleo_h743zi board, with tx async mode zephyrproject-rtos#93965:
```
before:
tcp upload: 71.3Mbps/s
tcp download: 75.11 Mbps/s

after:
tcp upload: 92.9Mbps/s
tcp download: 94.5Mbps/s
```

Signed-off-by: WenBin Zhang <[email protected]>
kartben pushed a commit that referenced this pull request Aug 27, 2025
For TCP, CONFIG_PICOLIBC_USE_MODULE=y has a significant impact
on performance.

Use nucleo_h743zi board with loopback:
```
before:
tcp upload: 49.35 Mbps/s

after:
tcp upload: 56.52 Mbps/s
```

Use nucleo_h743zi board, default config:
```
before:
tcp upload: 71.3Mbps/s
tcp download: 75.11 Mbps/s

after:
tcp upload: 75.3Mbps/s
tcp download: 94.39 Mbps/s
```

Use nucleo_h743zi board, with tx async mode #93965:
```
before:
tcp upload: 71.3Mbps/s
tcp download: 75.11 Mbps/s

after:
tcp upload: 92.9Mbps/s
tcp download: 94.5Mbps/s
```

Signed-off-by: WenBin Zhang <[email protected]>
ExaltZephyr pushed a commit to ExaltZephyr/zephyr that referenced this pull request Sep 16, 2025
For TCP, CONFIG_PICOLIBC_USE_MODULE=y has a significant impact
on performance.

Use nucleo_h743zi board with loopback:
```
before:
tcp upload: 49.35 Mbps/s

after:
tcp upload: 56.52 Mbps/s
```

Use nucleo_h743zi board, default config:
```
before:
tcp upload: 71.3Mbps/s
tcp download: 75.11 Mbps/s

after:
tcp upload: 75.3Mbps/s
tcp download: 94.39 Mbps/s
```

Use nucleo_h743zi board, with tx async mode zephyrproject-rtos#93965:
```
before:
tcp upload: 71.3Mbps/s
tcp download: 75.11 Mbps/s

after:
tcp upload: 92.9Mbps/s
tcp download: 94.5Mbps/s
```

Signed-off-by: WenBin Zhang <[email protected]>
@erwango
Copy link
Member

erwango commented Oct 6, 2025

@Freey0 Do you plan to continue this PR? If yes, which would be nice, please rebase on to of latest driver version (which could be considered as stable)

@Freey0
Copy link
Contributor Author

Freey0 commented Oct 7, 2025

@Freey0 Do you plan to continue this PR? If yes, which would be nice, please rebase on to of latest driver version (which could be considered as stable)你是否计划继续这个 Pull Request?如果是的话,那将很好,请在最新的驱动程序版本(可被视为稳定版)的基础上进行变基(rebase)

Now that the holiday is over, we will continue this pr

@Freey0 Freey0 force-pushed the eth_stm32_async_impl branch from 598b79b to 237779e Compare October 11, 2025 06:11
@Freey0 Freey0 force-pushed the eth_stm32_async_impl branch from 237779e to f36b61f Compare October 11, 2025 07:45
@Freey0 Freey0 force-pushed the eth_stm32_async_impl branch from f36b61f to 091ab90 Compare October 15, 2025 01:01
@Freey0
Copy link
Contributor Author

Freey0 commented Oct 15, 2025

@erwango Could you help conduct comprehensive testing on the farm? Thank you very much.

@Freey0 Freey0 force-pushed the eth_stm32_async_impl branch from 091ab90 to 234da6d Compare October 15, 2025 02:39
@erwango
Copy link
Member

erwango commented Oct 15, 2025

@erwango Could you help conduct comprehensive testing on the farm? Thank you very much.

@juickar Can you take this in charge ? This being said, this should only be considered as a simple non regression.
Tests performed in CI are pretty basic, so manual extra testing would be required.

@Freey0 Freey0 force-pushed the eth_stm32_async_impl branch from 234da6d to 2c34e59 Compare October 16, 2025 00:24
@zephyrbot zephyrbot requested a review from erwango October 16, 2025 00:26
@juickar
Copy link

juickar commented Oct 16, 2025

@erwango Could you help conduct comprehensive testing on the farm? Thank you very much.

@juickar Can you take this in charge ? This being said, this should only be considered as a simple non regression. Tests performed in CI are pretty basic, so manual extra testing would be required.

So tests are OK in the farm and I did manual testings with these series without touching at the zperf configuration:

=============
stm32h74x

UDP Upload : 75.83 Mbps -> 92.21 Mbps
TCP Upload : 73.41 Mbps -> 74.87 Mbps

UDP Download : 94.82 Mbps -> 94.70 Mbps
TCP Download : 52.6 Mbps -> 53.60 Mbps

=============
stm32h57x

UDP Upload : 67.51 Mbps -> 85.03 Mbps
TCP Upload : 52.51 Mbps -> 58.85 Mbps

UDP Download : 95.69 Mbps -> 95.69 Mbps
TCP Download : 45.11 Mbps -> 48.57 Mbps

=============
stm32f42x

UDP Upload : 47.86 Mbps -> 52.79 Mbps
TCP Upload : 31.58 Mbps -> 32.68 Mbps

UDP Download : 76.26 Mbps -> 76.53 Mbps
TCP Download : 34.66 Mbps -> 32.62 Mbps

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some implementation comments, aside performance impact.

@erwango erwango added this to the v4.3.0 milestone Oct 17, 2025
@Freey0 Freey0 force-pushed the eth_stm32_async_impl branch from 2c34e59 to fd66010 Compare October 17, 2025 15:15
@Freey0
Copy link
Contributor Author

Freey0 commented Oct 17, 2025

@juickar Many thanks for conducting such thorough testing. I'm particularly interested in the TCP section. Since #94888 has been merged, CONFIG_PICOLIBC_USE_MODULE=y is now enabled throughout the zperf sampling. TCP performance ought to be better than described in the pr. Indeed, my local tests confirm this. I've updated the test commands I use. Might you share your test commands? Let's see where the discrepancies lie.

@Freey0 Freey0 force-pushed the eth_stm32_async_impl branch from fd66010 to 4830f1e Compare October 17, 2025 15:56
tx_int_sem serves solely as a signal indicator and does not require signal
counting. Within eth_stm32_tx, the semaphore is reset each time a packet
is transmitted. Upon receiving the transmission completion signal, the
function exits. Signal counting is unnecessary. Change to a binary
semaphore.

Signed-off-by: WenBin Zhang <[email protected]>
Enable TX transmission asynchronous mode to enhance performance

Tested on the nucleo_h743zi board using samples/net/zperf

west build -b nucleo_h743zi/stm32h743xx samples/net/zperf/ --pristine
-- -DCONFIG_NET_CONFIG_MY_IPV4_ADDR=\"192.168.1.199\"

upload cmd:
```
//linux
iperf -s -l 1K -p 5001
iperf -s -l 1K -p 5002 -u

//shell
zperf tcp upload 192.168.1.109 5001 10 1K
zperf udp upload 192.168.1.109 5002 10 1K 300M
```

download cmd:
```
//shell
zperf tcp download 5001 192.168.1.199
zperf ucp download 5002 192.168.1.199

//linux
iperf -l 1K -c 192.168.1.199 -p 5001
iperf -l 1K -c 192.168.1.199 -p 5002 -u
```

before:
udp upload:   73.5Mbps/s
tcp upload:   71.3Mbps/s
udp download: 93.9Mbps/s
tcp download: 70.5Mbps/s

after:
udp upload:   92.2Mbps/s
tcp upload:   78.1Mbps/s
udp download: 93.7Mbps/s
tcp download: 75.2Mbps/s

Signed-off-by: WenBin Zhang <[email protected]>
enable STM32 etc_tx_async mode for testing in CI

Signed-off-by: WenBin Zhang <[email protected]>
@Freey0 Freey0 force-pushed the eth_stm32_async_impl branch from 4830f1e to 8c71b50 Compare October 18, 2025 01:22
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants