nuttx/arch/xtensa
Felipe Moura aa114f0ec0 xtensa/espressif: resync openeth RX/TX descriptor ring on ifup
openeth_receive() (arch/xtensa/src/common/espressif/esp_openeth.c)
tracks the next expected RX descriptor in priv->cur_rx_desc, an int
initialized to 0 exactly once, in esp_openeth_initialize(). QEMU's
esp32s3 machine models the OpenCores MAC's DMA ring pointer as
resetting to descriptor 0 every time RXEN is toggled off and back on
(openeth_disable()/openeth_enable(), called from ifdown()/ifup()), but
nothing rewinds the driver's own index to match. On the very first
bring-up both start at 0, so nothing looks wrong; from the second
ifup() onward the two permanently disagree, openeth_receive() keeps
inspecting the wrong descriptor, finds it still marked "owned by HW"
(e=1), and silently drops the notification. This breaks all inbound
traffic on the interface, not just application sockets -- ARP replies
and ICMP echo replies are RX frames too, so ping breaks identically.

Re-run the same descriptor initialization esp_openeth_initialize()
does at boot -- re-arm every RX/TX descriptor, rewind
cur_rx_desc/cur_tx_desc to 0 -- inside openeth_ifup(), under the same
critical section that already toggles RXEN.

Board-independent code, and open_eth only exists as a QEMU peripheral,
so there is no real-hardware regression risk.

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-09-17 07:37:01 -03:00
..
include xtensa: Support BUILD_KERNEL. 2026-09-10 23:28:43 +08:00
src xtensa/espressif: resync openeth RX/TX descriptor ring on ifup 2026-09-17 07:37:01 -03:00
CMakeLists.txt cmake:implement CMake build of xtensa arch 2024-11-02 18:08:38 +08:00
Kconfig arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00