mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
lacp: arm the partner timeout from our own LACP_Timeout
The receive machine armed current_while from the partner's TIMEOUT bit, so against a partner on the slow rate a port whose LACPDUs stopped with the link still up stayed in the trunk for the long timeout, two minutes. 802.3ad 43.4.12 starts the timer from the actor's own LACP_Timeout, and we always advertise the short one: the partner sends every second and is let go after the short timeout. Sandbox T23 plays a slow-rate partner that goes quiet and fails on the code before this.
This commit is contained in:
1 parent
56686185ce
commit
bd974e0aaf
2 files changed
+18
-2
No files matched your search
+1
-2
@@ -311,8 +311,7 @@ void lacp_in(void) __banked
|
|||||||
|
|
||||||
/* Receive machine -> CURRENT, (re)arm partner timeout (43.4.12) */
|
/* Receive machine -> CURRENT, (re)arm partner timeout (43.4.12) */
|
||||||
lacp_rx_state[port] = LACP_RX_CURRENT;
|
lacp_rx_state[port] = LACP_RX_CURRENT;
|
||||||
lacp_timeout[port] = (LACP_I->actor.state & LACP_STATE_TIMEOUT)
|
lacp_timeout[port] = LACP_SHORT_TIMEOUT;
|
||||||
? LACP_SHORT_TIMEOUT : LACP_LONG_TIMEOUT;
|
|
||||||
|
|
||||||
/* Elect this LAG's aggregator partner system on first contact (43.4.14) */
|
/* Elect this LAG's aggregator partner system on first contact (43.4.14) */
|
||||||
if (!lacp_agg_valid[lag]) {
|
if (!lacp_agg_valid[lag]) {
|
||||||
|
|||||||
@@ -458,6 +458,23 @@ int main(int argc, char **argv)
|
|||||||
"T22 truncated LACPDU ignored: the port does not record it");
|
"T22 truncated LACPDU ignored: the port does not record it");
|
||||||
lacp_lag_set(1, 0);
|
lacp_lag_set(1, 0);
|
||||||
|
|
||||||
|
/* T23: the partner asks for the long timeout (Linux's default slow rate).
|
||||||
|
* current_while is armed from OUR LACP_Timeout, which is short, so a
|
||||||
|
* partner that stops speaking LACP with the link up is dropped after the
|
||||||
|
* short timeout, not after two minutes. */
|
||||||
|
lacp_lag_set(1, 0x0030);
|
||||||
|
step(8);
|
||||||
|
for (int r = 0; r < 2; r++) {
|
||||||
|
partner_frame(4, SYS_A, P_ACT|P_AGG|P_SYNC, 1);
|
||||||
|
partner_frame(5, SYS_A, P_ACT|P_AGG|P_SYNC, 1);
|
||||||
|
step(8);
|
||||||
|
}
|
||||||
|
int slow_converged = hw_members_lag[1] == 0x0030;
|
||||||
|
step(4 * LACP_SHORT_TIMEOUT + 64);
|
||||||
|
CHECK(slow_converged && hw_members_lag[1] == 0,
|
||||||
|
"T23 partner on slow rate goes quiet: dropped after our short timeout");
|
||||||
|
lacp_lag_set(1, 0);
|
||||||
|
|
||||||
printf("\n%s (%d failure%s)\n", failures ? "SANDBOX: FAILURES" : "SANDBOX: ALL PASS",
|
printf("\n%s (%d failure%s)\n", failures ? "SANDBOX: FAILURES" : "SANDBOX: ALL PASS",
|
||||||
failures, failures == 1 ? "" : "s");
|
failures, failures == 1 ? "" : "s");
|
||||||
return failures ? 1 : 0;
|
return failures ? 1 : 0;
|
||||||
|
|||||||
Reference in new issue
Block a user