mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-09-02 15:02:51 +08:00
stp: warn when an enabled port cannot receive BPDUs
A port set to admit tagged frames only will never see a BPDU, because delivery rides the forward action and the ingress pipeline drops untagged frames before the L2 lookup. The failure is silent and looks like a dead receive path: the port turns edge after three seconds, the bridge elects itself root, and nothing hints at the ingress setting. Diagnosing exactly that cost most of a day on a live switch, with the neighbour provably transmitting the whole time. stp_setup() now prints one line per affected port, so the hint lands at "stp on" and at every config replay on boot. The check runs in its own loop after the MSTP write: port_ingress_filter_get() reads a register into sfr_data, which the state-building loop above is still using. The port number in the message is physical, matching what the ingress command takes. doc/stp.md explains why this can happen here and not on a normal bridge, where BPDUs are consumed before any VLAN classification. stp.rel stays at DSEG 5 with no OSEG and the image at 10498 bytes of XDATA.
This commit is contained in:
@@ -75,6 +75,7 @@ void port_eee_status(uint8_t port) __banked;
|
||||
void print_port_ingress_filter_mode(vlan_ingress_mode_t mode) __banked;
|
||||
bool port_ingress_vlan_filter_set(__xdata uint8_t port, __xdata bool enabled) __banked;
|
||||
bool port_ingress_vlan_filter_get(__xdata uint8_t port) __banked;
|
||||
vlan_ingress_mode_t port_ingress_filter_get(__xdata uint8_t port) __banked;
|
||||
void port_isolate(register uint8_t port, __xdata uint16_t pmask) __banked;
|
||||
uint16_t port_isolation_get(register uint8_t port) __banked;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user