samples: net: zperf: Add loopback overlay

This is useful to profile networking stack using loopback interface, a
TX only option is also added but disabled by default.

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
This commit is contained in:
Krishna T 2022-10-12 22:28:28 +05:30 committed by Carles Cufí
parent 3cc1a6e9b2
commit 52ddc6e32d
2 changed files with 18 additions and 0 deletions

View file

@ -0,0 +1,12 @@
CONFIG_NET_DRIVERS=y
CONFIG_NET_LOOPBACK=y
CONFIG_NET_LOOPBACK_MTU=1100
# Enable for testing TX only
CONFIG_NET_LOOPBACK_SIMULATE_PACKET_DROP=y
CONFIG_NET_BUF_DATA_SIZE=1100
# Optimized networking settings for performance
CONFIG_NET_PKT_RX_COUNT=32
CONFIG_NET_PKT_TX_COUNT=48
CONFIG_NET_BUF_RX_COUNT=32
CONFIG_NET_BUF_TX_COUNT=96

View file

@ -11,6 +11,9 @@
#include <zephyr/usb/usb_device.h>
#include <zephyr/net/net_config.h>
#ifdef CONFIG_NET_LOOPBACK_SIMULATE_PACKET_DROP
#include <zephyr/net/loopback.h>
#endif
void main(void)
{
#if defined(CONFIG_USB_DEVICE_STACK)
@ -23,4 +26,7 @@ void main(void)
(void)net_config_init_app(NULL, "Initializing network");
#endif /* CONFIG_USB_DEVICE_STACK */
#ifdef CONFIG_NET_LOOPBACK_SIMULATE_PACKET_DROP
loopback_set_packet_drop_ratio(1);
#endif
}