raiden00pl opened a new pull request, #21959: URL: https://github.com/apache/nuttx/pull/21959
## Summary netfwd_forward() runs in the worker of the device the packet came in on, but links and sets up a callback in the list of the device it goes out on, while that device's worker runs and frees those callbacks. The callback could run before it was set up, fwd was used after being freed, and d_polltype updates could be lost. Protect the callback list and fields with a spinlock, set up the forward callback under it, and make d_polltype atomic. A separate commit fixes an nxstyle error in netdev_register.c. ## Impact Fixes forwarding that stops under traffic in both directions on SMP or with more than one HP worker. ## Testing qemu-intel64, qemu-armv8a, rv-virt: NAT router with two NICs, CONFIG_SCHED_HPNTHREADS=2, TCP iperf in both directions. Before: forwarding stopped. After: works in every run. qemu-intel64 node/host iperf throughput unchanged. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
