zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.76k stars 6.56k forks source link

net: code improvement in process_data() for high throughput case #80289

Open MaochenWang1 opened 3 days ago

MaochenWang1 commented 3 days ago

Is your enhancement proposal related to a problem? Please describe. In process_data(), there are three net_packet_socket_input() called, looks redundant for running UDP throughput case. And can we skip/optimize some of these functions? I locally tried, skip these functions can improve UDP RX for 5 Mbps.

Describe the solution you'd like can we add some configs to skip some net_packet_socket_input() functions for high throughput case.

jukkar commented 2 days ago

Just disable CONFIG_NET_SOCKETS_PACKET so that the packet socket processing is not done. If you need packet socket support, then the calls are needed to handle raw packet data in sockets.

The three net_packet_socket_input() calls are each handling different kind of packet/raw sockets.

jukkar commented 2 days ago

It is probably possible to optimize the packet socket handling even further, patches are certainly welcome to improve performance.