Align continuation lines to the open parenthesis, align the register
defines in qca_edma.h with tabs as qca_ppe.h does, and fix the
operator spacing, blank lines and block comments that checkpatch
reports. No functional change.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25665
Signed-off-by: Robert Marko <robimarko@gmail.com>
Remove code that has no effect on kernel 6.18:
- qca_edma: get_drvinfo, which returns what the ethtool core fills in
from the parent device; NETIF_F_GRO and watchdog_timeo, which the core
sets itself or never reads without ndo_tx_timeout; the tailroom check
on a conduit whose needed_tailroom is always 0; the tx_min_size guard
around skb_put_padto(), which does nothing for a size of 0.
- qca_ppe: port range checks on ports DSA has already validated, NULL
checks before clk_set_rate(), the never-read ds->priv, the repeated
"ports" node check in the IPQ6018 mux setup and stores that are always
overwritten before they are read.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25665
Signed-off-by: Robert Marko <robimarko@gmail.com>
EEE is disabled on every PPE port because the MAC side of LPI was never
programmed. The GMAC has an LPI enable per port, a wake and idle timer
per port and a microsecond prescaler at PPE offset 0x400, as the HPPE
code in qca-ssdk has it. Program them from mac_enable_tx_lpi, offer LPI
at 100 and 1000 Mbit/s on the QSGMII, PSGMII and SGMII ports, enable
EEE by default and add support_eee.
On IPQ8074 EEE negotiates on links whose partner offers it, a 10 minute
soak with bursty traffic loses 0 of 2939 pings, throughput is unchanged
(302 Mbit/s both ways, n=3) and idle ping latency rises from 0.16 to
0.22 ms (n=3). qca-ssdk uses the same LPI registers on IPQ60xx; no
IPQ60xx board was available to run it.
Fixes: a3a6679538 ("qualcommax: qca_ppe: disable EEE to prevent idle-port egress wedge")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25665
Signed-off-by: Robert Marko <robimarko@gmail.com>
The second hash of the L2 table folds the top five bits of the 60-bit
seed, bits 59 to 55, into the key like the first one. It shifted the
seed left instead of right, so that term was always 0. Those bits are
bits 7 to 11 of the VLAN id, and for every VLAN from 128 up the driver
looked for an address learned in block 1 in the wrong bucket.
rtl930x_hash() carries a copy of the expression and gets the same
change.
Seen on RTL9303 with a host learned in bucket 2201 in VLAN 199: making
it static through the bridge wrote a second row for the same address
and VLAN in block 0 instead of converting the learned one, and deleting
the static entry left the learned row behind. A host learned in block 1
in VLAN 1 was found as before.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Quinn O'Shea <qoshea@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25697
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
rtldsa_port_fdb_dump() handed DSA e.vid, which on a unicast entry that
is not a next hop comes from the UC_VID field. The Realtek GPL SDK calls
that field agg_vid, auto-learned by the hardware for MAC-based N:1 VLAN
translation (rtk/l2.h). This driver never sets that translation up, so
the field is 0 on every learned entry, and bridge fdb show printed those
entries without a VLAN.
The VLAN an entry is keyed and forwarded on is FID_RVID, e.rvid.
rtldsa_port_fdb_add() hashes on it and writes it to both fields, which
is why static entries showed the right VLAN, and the RTL931x reader
already fills vid from it. Report e.rvid.
Tested on a Hasivo S1100W-8XGT-SE (RTL9303) with two hosts learned on
lan1 in VLANs 1 and 3. Their L2 entries read back with vid 0, the value
the dump passed on until now, and rvid 1 and 3; bridge fdb show now
lists them as vlan 1 and vlan 3. Compile-tested for rtl838x and rtl839x.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25690
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
A route through the switch takes an egress interface for the MAC of its
device and its VLAN, 64 of them, and nothing gave one back: it stayed in
hardware after the last route that used it was gone.
Count the routes that hold each egress interface. A route lets go of its
own in otto_l3_route_teardown(), once otto_l3_route_remove() has taken
its entry out of the hardware, except for a prefix route once the rows
are no longer where the driver records them (a failed move or a lookup
that timed out), whose row may still route through it. The IPv4 add path
lets go on its error paths, where nothing was written. The last route to
let go zeroes the interface's source MAC, which is what
otto_l3_alloc_egress_intf() takes for a free one. Driver removal leaves
the hardware as it was. RTL839x allocates none and is unchanged.
Router MACs stay as they were. A router MAC is what makes the switch
route what it receives on that MAC, so it lives as long as the interface
rather than the routes out of it, and following interfaces is a change
of its own.
Tested on a Hasivo S1100W-8XGT-SE (RTL9303) with a kprobe on
otto_table_write_bytes() logging the writes to the router MAC table and
to the egress interface source MACs. switch.3 takes a MAC no route uses,
and two /24 routes via the same gateway share one egress interface.
Deleting the first frees nothing and the second still forwards 5 of 5
echoes. Deleting the second zeroes the source MAC with this change and
writes nothing on main; neither writes the router MAC.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25682
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The video codecs sit behind their own IOMMUs, but with the default
domain set to passthrough their buffers have to be physically
contiguous and come out of the 16 MiB CMA pool. A 4K frame needs
15.8 MiB of it, so hardware decoding of 4K video fails allocation and
falls back to software: 10 seconds of 4K HEVC then cost 22 seconds of
CPU, where the decoder does the same work with 0.15.
Have rockchip-iommu ask for a translated domain for the masters it
serves, so the display, codec, ISP and RGA blocks get scatter-gather
while everything behind another IOMMU, PCIe included, keeps the system
default and its throughput.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The RK3588 camera path is two drivers: the video capture unit and the
MIPI CSI-2 receiver that feeds it. Package both, so a board with a
camera connector can use them.
kmod-video-rockchip-cif pulls in the receiver, since MIPI is the only
input the driver supports on RK3568 and RK3588.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The Sony IMX415 is the sensor on the Radxa Camera 4K and on several
other MIPI CSI-2 modules, and the driver is in the kernel already. Add
kmod-video-imx415 so a board with a camera connector has a sensor to
go with its capture driver.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Add the MIPI CSI-2 receiver nodes and the video capture unit to the
RK3588 device tree, so the drivers have something to bind to. Both
land disabled, and the CSI D-PHY nodes they connect to are already
in 6.18.
No board enables them yet: the connector wiring lives in a per-board
overlay, and upstream carries one only for the ROCK 5B+ so far.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The RK3588 camera path needs two drivers that landed after 6.18: the
Rockchip video capture unit, which gained rk3588 support in 7.2, and
the DesignWare MIPI CSI-2 receiver it is fed from, which arrived in
7.0. The CSI D-PHY and the imx415, imx219 and ov5647 sensors are in
6.18 already, so these two are what is missing.
Backport both drivers with their bindings. The i.MX93 and i.MX95
additions to the receiver come along, which keeps it at an upstream
state so that later fixes apply as they are.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Package the Rockchip DRM driver with VOP, VOP2, eDP, DP, HDMI, HDMI QP,
MIPI DSI and MIPI DSI2 support, the Rocket NPU driver, the Samsung
HDPTX and DCPHY and the Innosilicon CSI DPHY, the RKVDEC and RGA V4L2
drivers, the Synopsys HDMI receiver, the I2S, I2S/TDM and S/PDIF ASoC
drivers and the DFI DDR monitor, so that every device in the rk3588
device tree has its driver available.
The DFI DDR monitor is a devfreq event driver, so PM_DEVFREQ_EVENT is
set in the target configuration, which is what lets the driver build as
a module and be installed on a released image. The remaining new
symbols are recorded as disabled defaults in the generic configuration,
where a kernel module package can enable the one it needs. The per-SoC
V4L2 mem2mem drivers go there as well: they have no recorded value
anywhere, so kconfig stops to ask for them on any target whose ARCH
symbol matches once kmod-video-mem2mem opens the mem2mem menu.
The DRM driver and the HDMI PHY are marked for /etc/modules-boot.d, as
procd loads those before preinit runs. Loaded from /etc/modules.d
instead, /dev/dri stays empty until the overlay is mounted, which on a
Rock 5B is several seconds in and too late for anything drawing to the
screen during boot.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Package the simple-audio-card and audio-graph-card drivers with their
shared utilities, the HDMI codec used by DRM bridges with an HDMI
audio path, and the Everest ES8316 codec.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Package the H.264, VP9 and JPEG helper modules on their own so several
stateless codec drivers can share them, and add the Hantro VPU driver
used by i.MX8M, Rockchip, Allwinner, Microchip and ST SoCs. The i.MX
CODA package takes the JPEG helper from the new package.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Package the Synopsys DW DisplayPort, HDMI, HDMI QP, MIPI DSI and MIPI
DSI2 bridges, the Analogix DisplayPort bridge with the DP AUX bus, the
GPUVM helper and the Panthor driver for ARM Mali CSF GPUs. The HDMI QP
bridge depends on the HDMI codec module for its audio path.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
CONFIG_VIDEO_DEV builds v4l2-dv-timings.ko next to videodev.ko, but the
package only installs the latter, so a driver that needs the DV timings
helpers, such as the Synopsys HDMI receiver, cannot be packaged.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The Panthor driver loads arm/mali/arch<version>/mali_csffw.bin for the
Mali GPUs with a command stream front end, such as the G610 in the
RK3588. Package every architecture version so one package serves all
of them.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The DW HDMI QP bridge exposes its audio path through the DRM HDMI audio
helper, which registers an hdmi-audio-codec platform device. Nothing on
that path selects the promptless SND_SOC_HDMI_CODEC, so the RK3588 HDMI
outputs have no audio unless another driver happens to pull the codec
in. Select it from ROCKCHIP_DW_HDMI_QP as the CDN DP option does.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Add the VDPU381 decoder nodes with the register block order and power
domain node names the rkvdec binding expects, correct the PCIe range
mappings and the NPU IOMMU unit addresses, and add the missing eDP
clocks.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Bring in the media/rkvdec series that adds decoder variants, the HEVC
backend and the VDPU381 and VDPU383 H.264 and HEVC backends used by the
RK3588 and RK3576, together with the Hantro AV1 and G2 fixes, the HEVC
control additions and validations in v4l2-ctrls and the v4l2-mem2mem
changes they build on. Fixes that 6.18.44 stable already carries are
left out.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
An IPv4 route can be for one DSCP value (ip route add ... tos), and the
kernel then routes only packets that carry that value through it. The
switch's entry matches on the destination alone, so an offloaded route
of that kind took every packet for the destination, whatever its DSCP.
Treat it like a multipath route: it gets a trapping entry and the CPU
routes its traffic. otto_l3_fib_del_v4() takes it through the same
branch. The overview at the top of l3.c is updated to match. RTL839x,
which routes through PIE rules and has no trapping entries, no longer
offloads such a route, though an offloaded shorter prefix still forwards
its destination there whatever the DSCP; not tested there.
Of the routes for one destination the kernel notifies only the first,
and one for a DSCP value comes before the one without, so the
destination traps for as long as a DSCP route for it exists, and the
other one arrives as a replace when it goes.
Tested on a Hasivo S1100W-8XGT-SE (RTL9303) with 10.99.0.0/16 via one
gateway, 10.99.70.0/24 tos 0x10 via another, and 8 echoes to the /24
with each TOS value. On main the /24 forwards in hardware and 8 of 8
echoes with TOS 0 and 8 of 8 with TOS 0x10 reach its gateway. With this
change it traps: TOS 0 reaches the /16's gateway and TOS 0x10 the /24's,
8 of 8 each, and adding the /24 without tos, which the kernel does not
notify, keeps it so; on main it stays as before. Deleting the tos route
brings the other one in as a replace, and on both the /24 forwards all
16 to its own gateway. The round on trap rows passes, 46 of 46.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25683
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The "name=value\0 ... \0\0" walk over the mmap()ed nvram used strchr()
and strlen() without a bound, so an nvram without the terminating
double NUL made it run past the end of the mapping.
Search with memchr() up to the length from the nvram header, or up to
the end of the mapping when that length does not fit, so a broken
header is still readable. A variable that is not terminated in this
area ends the parsing.
Map a regular file, like the /tmp staging file, only as far as it is
backed, rounded down to 4 bytes for the padding in nvram_commit(),
instead of the partition size which raised SIGBUS. Only search the
start of a mapping smaller than NVRAM_MIN_SPACE for the magic instead
of underflowing the loop boundary; bcm47xxpart creates such nvram
partitions on flashes with 4 KiB erase blocks.
"nvram info" clamps the header length before the CRC8, it read beyond
the mapping or underflowed into a 4 GB read before.
This is reachable with a crafted nvram partition or staging file, on
bcm47xx the nvram partition is also parsed while booting.
Reported by @tonoyx91 and @0xROI.
Link: https://github.com/openwrt/openwrt/security/advisories/GHSA-5m25-qmhm-crr4
Fixes: 400c1a7fbf ("Add unvram, a nvram manipulation tool suitable for brcm-2.4 and bcm47xx platforms")
Assisted-by: Claude:claude-opus-5
Link: https://github.com/openwrt/openwrt/pull/25240
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The Adtran SDG-9000 is a 10G PoE router in a white steel case with
optional 19" rackmount brackets.
Specifications:
* MediaTek MT7988A (4x Cortex-A73)
* 32 GB eMMC
* 4 GiB DDR4 RAM
* 1x 10000M/5000M/2500M/1000M/100M combo WAN: RJ45 (Marvell
CUX3410 PHY) or SFP+ cage, selected at boot
* 1x 10000M/5000M/2500M/1000M/100M LAN port (Marvell CUX3410 PHY)
* 8x 2500M/1000M/100M/10M LAN ports with PoE+ (MaxLinear MxL86282
switch with built-in PHYs), 200 W total PoE budget, two Skyworks
Si3474 PSE controllers
* 1x 1000M/100M/10M management port (MT7988 built-in PHY)
* 240x240 TFT touchscreen (ST7789 SPI LCD with CST816S touch)
* 1 button (Reset)
* uC-controlled RGB LED via I2C
* RGBW LED for each PoE LAN port, 2x LED for the management port,
3x LED for each 10G port, 2x LED for the SFP+ cage
* 2x PWM fan (mainboard, power supply)
* USB 3.0 type A port
* USB-C console port, 115200 baud, Holtek HT42B534 USB-UART bridge
* 100-240V AC 50-60Hz power input, IEC 60320 C14 inlet
The WAN port is selected by a GPIO-controlled mux that has no runtime
control, so it is chosen by one of two device tree overlays, wan-phy
and wan-sfp, carried as configurations of the FIT image. The mux is
selected by setting boot_default_config in the U-Boot environment:
config-1 no WAN port
config-1#mt7988a-smartrg-sdg-9000-wan-phy RJ45 (CUX3410)
config-1#mt7988a-smartrg-sdg-9000-wan-sfp SFP+ cage
MAC addresses (base MFG_MAC from the mfginfo partition; the nvmem
cell index in the DTS is added to the base):
wan xx:xx:xx:xx:xx:x0 MFG_MAC
aux xx:xx:xx:xx:xx:x0 MFG_MAC
lan1-lan9 xx:xx:xx:xx:xx:x1 MFG_MAC + 0x1
br-lan xx:xx:xx:xx:xx:x1 MFG_MAC + 0x1
The label shows MFG_MAC. aux is the only port present when netifd
starts, as lan1-lan9 appear once the mxl862xx driver has loaded, so
br-lan would take the MAC of aux. board.d sets the MAC of br-lan to
that of lan1-lan9.
Installation:
1. Prepare a TFTP server at 192.168.1.254 and serve the OpenWrt
initramfs image, renamed to "openwrt.500".
2. Connect to the Management/Auxilary port.
3. Connect to the USB-C console port (USB CDC-ACM, 115200 8n1)
4. Power on the device and type "st" to enter the U-Boot command
line. The window to do that might be very short, so type it as
soon as the "U-Boot ..." string appears.
5. Run "setenv boot_mode openwrt; saveenv" to boot from OpenWrt
partition by default.
6. Run "bootmenu" and select option 6 (TFTP openwrt image and
boot); "run boot5" is a shortcut for the same. This downloads
openwrt.500 from the TFTP server and boots it.
7. After OpenWrt finishes booting, download the OpenWrt sysupgrade
image and write it to eMMC using "sysupgrade".
8. After sysupgrade finishes writing, the device reboots into
OpenWrt. When the System LED is solid white the device is ready
for configuration.
9. To use the WAN port, set boot_default_config to one of the values
above, e.g. from OpenWrt with
"fw_setenv boot_default_config config-1#mt7988a-smartrg-sdg-9000-wan-sfp".
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The preinit hook that applies the label and openwrt,netdev-name DT
properties only sees the netdevs registered before it runs. The ethernet
driver of the SDG-9000 registers its netdevs about two seconds after
preinit has started, so they keep their ethN names.
Move the rename into a shared helper and call it from a hotplug net rule
as well, which handles netdevs registered once userland is up.
Also register the netdev rename for the preinit_netdev boot hook so that
netdevs registered while preinit is running get their DT name before the
preinit interface is configured.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
preinit_ip runs once when preinit starts and configures the preinit
interface only if its driver has already registered it. Drivers that
probe while preinit is running leave failsafe without a network.
Run procd's preinit hotplug daemon on net add events, as the rule in
hotplug-preinit.json.d does, and have it start /sbin/preinit-netdev.
The script runs the new preinit_netdev boot hook, which targets use to
rename the new netdev, and then calls preinit_ip_event, which
configures the preinit interface unless it already carries the
preinit address.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Register LED triggers for each SFP cage representing module state:
- present: the module is detected.
- los: loss of signal, using the module's own declared polarity. I
split that logic out of the link check into sfp_los_asserted() so
both use the same code.
- tx-fault: the state machine reports a transmit fault (init fault,
fault, re-init, or persistently disabled).
- error: the module is in error, covering an unreadable EEPROM or I2C
failure, an unsupported module, or a failed power-up, plus the
failed-PHY state.
- fault: either tx-fault or error.
Refresh target patches affected by the generic addition.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Add a per-PI fault LED trigger to the PSE core, an interrupts
property to the Si3474 binding, and INTb handling to the Si3474
driver. Over-current events latch a fault state that the driver
reports as FAULT, which lights the fault trigger. Power good and
power enable changes update the delivering and enabled triggers
without waiting for a regulator operation.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
AutoProbe places a module in etc/modules.d, which kmodloader loads
from /etc/init.d/boot once preinit has finished, so a MIPI DBI panel
only lights up late in the boot. With the boot flag the module is
linked into etc/modules-boot.d as well, which is loaded before the
preinit scripts, together with its dependencies.
Set the flag on the panel driver and on pwm_bl, because the panel
defers its probe until the backlight it references has registered.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Package kernel driver for the Hynitron CST816x touch sensor, found on
ST7789V-based 240x240 px MIPI-DBI display of the Adtran SmartRG SDG-9000.
Import pending patches improving the driver.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Apply the established OpenWrt packaging pattern of a firmware package
depending on its only consumer.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Add the controller init sequence for the PH240240T004-ZAR 240x240 LCD
as the mipi-dbi-ph240240t004-zar package. panel-mipi-dbi requests it
for a panel node whose first compatible string is "ph240240t004-zar".
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The panel-mipi-dbi driver requests "<compatible>.bin", a blob that the
upstream mipi-dbi-cmd tool assembles from a readable list of controller
commands and delays. Keep only that list in files/, vendor the
CC0-licensed tool, and assemble the blob in Build/Compile with the host
python3 the build system already requires. Every .txt in files/ is
assembled, so a further panel needs only its command list and an
install recipe.
Link: https://github.com/notro/panel-mipi-dbi
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
A MIPI DBI init sequence is a target-independent data blob holding
controller commands and delays, so one build serves every architecture.
Mark the packages accordingly.
Fixes: 51627b9699 ("mipi-dbi: add MIPI DBI LCD init sequence packages")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The compressed LoongArch kernel (vmlinuz.efi) differs between builds in
different directories. The code and data of vmlinux are identical, but
its GNU build ID is not: the debug information of vmlinux holds a
single absolute path, the include directory of the compiler, e.g.
/builder/shared-workdir/build/staging_dir/toolchain-loongarch64_generic_gcc-14.4.0_musl/lib/gcc/loongarch64-openwrt-linux-musl/14.4.0/include
asm/loongarch.h includes the compiler's larchintrin.h, so core files
like arch/loongarch/kernel/cpu-probe.c refer to it. The prefix maps of
the kernel cover the build and the staging directory, but not the
toolchain directory. The build ID hashes all of vmlinux, so it depends
on the build directory, and with it the compressed kernel.
Map the toolchain directory as well, like the staging directory.
On loongarch64/generic, vmlinux built without the map holds this one
absolute path, like the published one; built with it, no absolute path
is left, while .text, .rodata and .data stay byte-identical.
Link: https://github.com/openwrt/openwrt/pull/25648
Signed-off-by: Paul Spooren <mail@aparcar.org>
The debugfs dump kept a record of its own, otto_l3_930x_dump_rec, with a
copy of a route's attributes, and decoded host and prefix rows with its
own copies of the readers' field positions. Split the decoding out of
otto_l3_930x_host_route_read() and otto_l3_930x_route_read() into
decoders that work on a fetched row, use them in the readers, the dump
and the hit clearing, and keep in the record only where an entry sits
and the route it holds.
The dump prints the same. The two debug lines that showed the prefix
reader's intermediate host route, default route and mask bits go with
the decoding they sat in; the prefix length the reader still prints is
what they add up to.
Tested on a Hasivo S1100W-8XGT-SE (RTL9303) with IPv4 host routes and
IPv4 and IPv6 prefix routes, forwarding and trapping. The routes dump,
taken after traffic to the forwarding ones and again after
clear_route_hits, matches main field by field, 28 rows each. Left out of
the comparison are the ULA prefix each boot picks, and the hit bit
outside the three rows that carried the test traffic, which other
traffic can set at any moment. On those three rows the hit bit goes from
1 to 0.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25669
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
A forwarding entry points at a next hop entry, which names the gateway's
L2 entry and an egress interface. Three paths wrote them so that an
entry could forward through a next hop that was not, or no longer, what
it should be:
- otto_l3_route_update_hw() wrote the entry as forwarding and only
then its next hop.
- When a forwarding route's gateway came back with a new MAC,
rtldsa_l2_nexthop_add() released the old L2 entry while the entry
still forwarded through it.
- otto_l3_route_teardown() released the L2 entry first, and took the
PIE rule and the entry down after it.
Write the next hop before the entry that points at it, let a forwarding
route trap where it is while its next hop moves to a new MAC, and take
the PIE rule and the entry down before the L2 entry they forward to. A
family that routes through a PIE rule has no entry that traps, so there
the MAC change keeps the order it had and only the teardown changes.
Tested on a Hasivo S1100W-8XGT-SE (RTL9303) with a kprobe on
otto_table_write_bytes() that logs the writes made through it to the L2,
next hop, egress MAC and prefix route tables, with the route entry's
action. For a /24 via a resolved gateway, main wrote the entry as
forwarding before its next hop, released the old L2 entry while the
entry forwarded when the gateway changed MAC, and released the L2 entry
before invalidating the entry on delete. With this change the next hop
comes first, the entry traps across the MAC change, and it is
invalidated before the L2 entry goes. On both, echoes reach the gateway
at its new MAC, and a gateway moved to a MAC no port has logs "no port
for" once. The rounds on trap rows, source-specific IPv6 routes, switch
addresses that shadow main routes and IPv4 multipath pass: 46 of 46,
20 of 20, 17 of 17 and 15 of 15. The PIE rule path was only
compile-tested.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25668
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The next change calls it from otto_l3_route_update_hw(), which comes
earlier in the file. Move it, unchanged, to just after
otto_l3_route_install(), the helper it pairs with. No functional change.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25668
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
target/linux/generic disables CONFIG_VT and this fragment switches it
back on, along with the dummy console and the console translations.
No fbdev or DRM display driver is enabled here, so the terminal has
nothing to bind to; it is kernel size every image pays for. Drop it.
The serial console is unaffected and INPUT stays enabled in its own
right.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
target/linux/generic disables CONFIG_VT and this fragment switches it
back on, along with the dummy console and the console translations.
No fbdev or DRM display driver is enabled here, so the terminal has
nothing to bind to; it is kernel size every image pays for. Drop it.
The serial console is unaffected and INPUT stays enabled in its own
right.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
target/linux/generic disables CONFIG_VT and this fragment switches it
back on, along with the dummy console and the console translations.
No fbdev or DRM display driver is enabled here, so the terminal has
nothing to bind to; it is kernel size every image pays for. Drop it.
The serial console is unaffected and INPUT stays enabled in its own
right.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
target/linux/generic disables CONFIG_VT and this fragment switches it
back on, along with the dummy console and the console translations.
No fbdev or DRM display driver is enabled here, so the terminal has
nothing to bind to; it is kernel size every image pays for. Drop it.
The serial console is unaffected and INPUT stays enabled in its own
right.
HW_CONSOLE goes with it, as no kernel in the tree defines it.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
target/linux/generic disables CONFIG_VT and this fragment switches it
back on, along with the dummy console and the console translations.
No fbdev or DRM display driver is enabled here, so the terminal has
nothing to bind to; it is kernel size every image pays for. Drop it.
The serial console is unaffected and INPUT stays enabled in its own
right.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
target/linux/generic disables CONFIG_VT and this fragment switches it
back on, along with the dummy console and the console translations.
No fbdev or DRM display driver is enabled here, so the terminal has
nothing to bind to; it is kernel size every image pays for. Drop it.
The serial console is unaffected and INPUT stays enabled in its own
right.
The compiled-in fonts stay, as EFI_EARLYCON selects FONT_SUPPORT.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>