]> git.ipfire.org Git - thirdparty/openwrt.git/commit
rtl93xx: dsa: Handle lag_change properly 21740/head
authorHarshal Gohel <hg@simonwunderlich.de>
Tue, 27 Jan 2026 11:35:16 +0000 (11:35 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 7 Mar 2026 19:33:22 +0000 (20:33 +0100)
commit89322b4d69a75ccf1758794b0bce7af375ce1ca1
tree938607ed0b5f50e0cf6865dea13203fd25ef16f6
parent05096060caa0871130b1cb7ad83ba0b8d7bd7b75
rtl93xx: dsa: Handle lag_change properly

LACP frequently changes active/backup links. driver must also handle
dp->lag_tx_enabled.

This should only affect egress LAG table, ingress should not be touched.
To test, connect a known working 802.3ad compatible switch (Mikrotik).
Configure bond with 802.3ad on openwrt as well as mikrotik.
Observer active/backup links on openwrt with
```
for iface in <list of bond participants>; do
ip -d link show $iface
done
```
This should show ACTIVE/BACKUP status which must be synchronized with
the partner's ACTIVE/BACKUP status if LACP is working correctly.

Backup interface must not be chosen by the distribution algorithm to
transmit egress packet

At the moment, we have two parties involved in the selection of active LAG TX
ports:
- the bonding/DSA code which informs about activated/deactivated ports using
  .port_lag_change
- the HW which is deactivating ports based on the link state see
  RTL93XX_TRK_CTRL_LINK_DOWN_AVOID

In our case, the software is supposed to manage everything

Co-developed-by: Sven Eckelmann <se@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/21740
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c