mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
l2: name the group a learned address sits behind
A device on an aggregate is learned against whichever member the frame came in on, and the hash moves that around: the same address changes port every time the flow mix changes. The table was telling the truth and there was no way to read it, since nothing on the page or the console says those two ports are one link. port_lag_of() already exists and already knows the answer, so both views ask it. The console prints LAG1 in place of the member, and /l2.json carries a "lag" field beside the port, 0 when the port stands alone, which is the shape /stp.json already uses. Costs 151 bytes of BANK1.
This commit is contained in:
1 parent
8a7b146892
commit
8b7306f995
3 files changed
+22
-3
No files matched your search
@@ -359,6 +359,7 @@ void send_l2(uint16_t idx)
|
||||
while (1) {
|
||||
entries_left--;
|
||||
uint8_t port = 0;
|
||||
uint8_t lag;
|
||||
reg_read_m(RTL837x_TBL_DATA_0);
|
||||
REG_WRITE(RTL837x_TBL_DATA_0, sfr_data[0], sfr_data[1] & 0xfc, sfr_data[2] | (TBL_LUTREAD_NEXT_L2UC << 6), sfr_data[3]);
|
||||
|
||||
@@ -402,6 +403,9 @@ void send_l2(uint16_t idx)
|
||||
|
||||
port |= (sfr_data[3] & 0x3) << 2;
|
||||
itoa_html(port);
|
||||
slen += strtox(outbuf + slen, ",\"lag\":");
|
||||
lag = port_lag_of(port);
|
||||
itoa_html(lag == PORT_LAG_NONE ? 0 : lag + 1);
|
||||
}
|
||||
|
||||
// Index
|
||||
|
||||
Reference in new issue
Block a user