mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
port: pin the management MAC to the CPU port with a static L2 entry
The CPU's own MAC exists in the L2 table only as a learned entry, created whenever the CPU transmits, and it ages out like any other dynamic entry. Unknown unicast is not flooded to the CPU port, so on an idle switch (no web session, no management traffic) the entry expires after the aging time and frames for the management IP no longer reach the CPU: pings die until the next CPU transmission (an ARP reply) re-teaches the entry, then die again. Real management sessions keep the entry alive continuously, which is why this is only visible on idle switches. Install a static entry for the management MAC on the CPU port after the startup config has been replayed, so it lands in the final management VLAN, and move it when the management VLAN is changed at runtime. Entry mechanics, established on hardware: a table write with read-method 0 hashes the key in TBL_DATA_IN and places the entry itself (a search returns index 0 on a miss, there is no software-visible insertion slot). The age field in the third data word must be non-zero for the entry to be visible to lookup at all, and the static flag (bit 0 of byte 1 of that word) stops the aging engine from decrementing it: with the flag a full-age entry survives untouched where an identical unflagged entry ages to invisible within the aging period. With no management VLAN configured the entry lives in VLAN 1.
This commit is contained in:
1 parent
4c8e0ce975
commit
3b8dba6e87
4 files changed
+60
No files matched your search
@@ -81,5 +81,6 @@ bool port_ingress_vlan_filter_get(uint8_t port) __banked;
|
||||
vlan_ingress_mode_t port_ingress_filter_get(__xdata uint8_t port) __banked;
|
||||
void port_isolate(uint8_t port, __xdata uint16_t pmask) __banked;
|
||||
uint16_t port_isolation_get(uint8_t port) __banked;
|
||||
void port_l2_static_mgmt(__xdata uint8_t *mac, __xdata uint16_t vlan, __xdata bool remove_entry) __banked;
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user