Skip to content

Commit

Permalink
samples: net: zperf: Optimize configuration for better performance
Browse files Browse the repository at this point in the history
Increase the number of network packets and buffers for better TCP
performance in the sample out-of-the-box.
Decrease the network buffer data size for better buffer management in
the sample (less buffer space wasted for L2 header). The only drawback
of this is reduced TCP TX performance, but less than 2 Mbps in my case.
Finally, enable speed optimizations for another small performance boost.

As the RAM requirements of the sample now increase considerably in the
default configuration, add a note in the readme file about it, and how
to make it fit into smaller boards.

Tested on nucleo_h723zg:
  Before (current defaults):
    UDP      TX          RX
         76.47 Mbps  93.48 Mbps
    TCP      TX          RX
         76.18 Mbps  67.75 Mbps

  After (new defaults):
    UDP      TX          RX
         76.08 Mbps  93.62 Mbps
    TCP      TX          RX
         74.19 Mbps  85.51 Mbps

Signed-off-by: Robert Lubos <[email protected]>
  • Loading branch information
rlubos committed Jul 5, 2024
1 parent 2c34da9 commit ce805a0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
11 changes: 11 additions & 0 deletions samples/net/zperf/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ This sample application has been tested on the following platforms:
- Arm FVP BaseR AEMv8-R
- ARM BASE RevC AEMv8A Fixed Virtual Platforms

For best performance, the sample configures a lot of network packets and buffers.
Because of this, the sample's RAM requirements are quite large. In case the
sample does not fit into target platform RAM, reduce the following configs:

.. code-block:: cfg
CONFIG_NET_PKT_RX_COUNT=40
CONFIG_NET_PKT_TX_COUNT=40
CONFIG_NET_BUF_RX_COUNT=160
CONFIG_NET_BUF_TX_COUNT=160
Requirements
************

Expand Down
12 changes: 7 additions & 5 deletions samples/net/zperf/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ CONFIG_NET_IPV4=y
CONFIG_NET_DHCPV4=n
CONFIG_NET_UDP=y
CONFIG_NET_TCP=y
CONFIG_NET_TCP_IPV6_ND_REACHABILITY_HINT=y
CONFIG_NET_STATISTICS=y

CONFIG_NET_PKT_RX_COUNT=14
CONFIG_NET_PKT_TX_COUNT=14
CONFIG_NET_BUF_RX_COUNT=28
CONFIG_NET_BUF_TX_COUNT=28
CONFIG_NET_BUF_DATA_SIZE=1500
CONFIG_NET_PKT_RX_COUNT=40
CONFIG_NET_PKT_TX_COUNT=40
CONFIG_NET_BUF_RX_COUNT=160
CONFIG_NET_BUF_TX_COUNT=160
CONFIG_NET_BUF_DATA_SIZE=256
CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=4
CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT=5
CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=1
Expand Down Expand Up @@ -40,3 +41,4 @@ CONFIG_LOG=y
CONFIG_SHELL_CMDS_RESIZE=n

CONFIG_CACHE_MANAGEMENT=y
CONFIG_SPEED_OPTIMIZATIONS=y

0 comments on commit ce805a0

Please sign in to comment.