port: show how many MAC addresses each port has learned

The switch keeps a count of the dynamic L2 entries learned on every
port in L2_LRN_PORT_CONSTRT_CNT (0x53ac + 4 * port, 13 bits). `stat`
prints it in a new MACs column and /status.json carries it as "macs".

On a SWTGW218AS the count matched the L2 table port by port, static
entries are not included, and taking a port down drops it to 0.
This commit is contained in:
DrDoof committed 2026-10-10 01:11:11 +02:00
1 parent e67c928eb7
commit 706dea63a2
4 files changed
+27 -1

No files matched your search

+2
View File
@@ -214,6 +214,8 @@
#define RTL837x_L2_TBL_FLUSH_CNF 0x53dc
#define RTL837X_L2_LRN_PORT_CONSTRAINT 0x5384
#define RTL837X_L2_LRN_PORT_CONSTRT_ACT 0x4f80
#define RTL837X_L2_LRN_PORT_CONSTRT_CNT 0x53ac
#define L2_LRN_PORT_CNT_MASK 0x1fff
#define RTL8373_REG_MAC_L2_PORT_MAX_LEN 0x1250
/*