openwrt-pf/target/linux/realtek/files-6.18
Markus Stockhausen 5ad22ced64 realtek: eth: adapt interrupt handling for fragments
The existing interrupt handling of the ethernet driver worked
well until the driver implemented receive fragment handling.
This change uncovered a constellation that did not exist before.

A received packet is written into the page pool with multiple
fragments. On RTL93xx the head-of-line (HOL) feature limits
the number of receivable fragments perfectly. There will never
be a "buffer full" situation where the hardware only encounters
ring buffers that are held by the Linux kernel. On RTL83xx
this is slightly different:

- The driver programs free floating rings
- Only the ownership flag of the ring buffer decides if the
  hardware can hand over a packet to the CPU.
- So the hardware can receive a packet even if it does not
  completely fit into the available fragments.

With this there is a small chance that

- The buffer has less space than a just received packet
- The hardware generates an overflow (RUN OUT) interrupt
- With no completely received packet the hardware DOES NOT
  generate a receive (DONE) interrupt.

So it is not sufficient to just look on the DONE interrupts.
The RUN OUT interrupts must be inspected as well. As the
current logic is quite cryptic enhance this as follows:

- Provide new RTL83xx/RTL93xx specific helpers
- Add new callbacks to the driver configuration structure
- Link the configuration with the new helpers
- Use the callbacks where needed.

While we are here:

- Enable only interrupts for active receive rings. Until
  now the driver activated all receive interrupts (8/32)
  although it supports only 2 rings.
- Use DIV_ROUND_UP instead of classic division for register
  calculation.

Link: https://github.com/openwrt/openwrt/pull/24538
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-08-04 19:55:42 +02:00
..
arch/mips/include/asm/mach-rtl-otto realtek: convert to generic machine initialization 2026-07-27 21:18:38 +02:00
drivers realtek: eth: adapt interrupt handling for fragments 2026-08-04 19:55:42 +02:00
include/dt-bindings/clock
net/dsa realtek: dsa/eth: adapt receive path 2026-06-26 16:43:25 +02:00