JorgeGzm opened a new pull request, #19930:
URL: https://github.com/apache/nuttx/pull/19930
## Summary
Two independent fixes to the STM32H7 Ethernet driver, split out of #19911
at review request.
**Never transmit a reply into a full TX ring**
`stm32_receive()` replies to ARP, IPv4 and IPv6 straight from the RX path
without checking whether a TX descriptor is free. Under sustained load the
reply overwrites a descriptor the DMA still owns and the link stalls until
the interface is reset.
All three reply paths now check `stm32_txringfull()` first. That check has
to consider `des0` as well as the OWN bit: a descriptor already consumed by
the DMA but not yet reclaimed still has its buffer pointer set, and
treating it as free is what corrupts the ring.
**Allow restricting autonegotiation to 10BASE-T full duplex**
New `CONFIG_STM32_AUTONEG_10FD_ONLY`, default n. On a board whose display
generates enough noise to corrupt 100BASE-TX, throughput collapses with
whatever is on the screen. Advertising only 10BASE-T full duplex makes both
ends negotiate a link that survives the interference.
It advertises rather than forcing the MCR, so the two ends still agree. A
forced setting on one side produces a duplex mismatch, which looks exactly
like a bad cable and is much harder to diagnose.
## Impact
No functional change for existing users. Both are confined to
`arch/arm/src/stm32h7/stm32_ethernet.c` and the shared
`arch/arm/src/common/stm32/Kconfig.eth`; the new option defaults to n, so
nothing changes unless a board opts in.
The TX ring guard costs one descriptor read per received packet that gets
a reply.
## Testing
Host: Linux, arm-none-eabi-gcc 13.2.
Board: linum-stm32h753bi (STM32H753BI, 1024x600 RGB panel), `netnsh`.
TX ring: sustained ping flood and TCP transfer while the panel was being
redrawn. Before the change the link stalled and only a reset recovered it.
After, the interface stayed up for the whole run.
Autonegotiation: measured throughput with the panel showing static content
against animated content.
nsh> ifconfig
eth0 Link encap:Ethernet HWaddr 00:e0:de:ad:be:ef at RUNNING mtu 1486
inet addr:192.168.15.4 DRaddr:192.168.15.1 Mask:255.255.255.0
stm32_eth: link full-duplex 100 Mbps (default)
stm32_eth: link full-duplex 10 Mbps
(CONFIG_STM32_AUTONEG_10FD_ONLY=y)
With 100BASE-TX the transfer rate varied by up to 200x depending on screen
content. With the option enabled the link is slower on paper and steady in
practice.
--
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]