diff options
author | Ethan Jackson <ethan@nicira.com> | 2011-03-08 16:34:20 -0800 |
---|---|---|
committer | Ethan Jackson <ethan@nicira.com> | 2011-03-18 11:33:02 -0700 |
commit | 269340fac3602303e30d46181652a7c90bde0e5e (patch) | |
tree | 4b1ed74791db1cd6b0c8be7a049deb2b84ac94ef /lib/lacp.c | |
parent | 77fdfa9bf71aff101219b249955842f6dc59b5c9 (diff) |
lacp: Enable "fast" lacp timing mode.
Diffstat (limited to 'lib/lacp.c')
-rw-r--r-- | lib/lacp.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -47,6 +47,7 @@ struct lacp { struct hmap slaves; /* Slaves this LACP object controls. */ struct slave *key_slave; /* Slave whose ID will be the aggregation key. */ + bool fast; /* Fast or Slow LACP time. */ bool negotiated; /* True if LACP negotiations were successful. */ bool update; /* True if lacp_update() needs to be called. */ }; @@ -127,7 +128,7 @@ lacp_destroy(struct lacp *lacp) void lacp_configure(struct lacp *lacp, const char *name, uint8_t sys_id[ETH_ADDR_LEN], uint16_t sys_priority, - bool active) + bool active, bool fast) { if (!lacp->name || strcmp(name, lacp->name)) { free(lacp->name); @@ -137,6 +138,7 @@ lacp_configure(struct lacp *lacp, const char *name, memcpy(lacp->sys_id, sys_id, ETH_ADDR_LEN); lacp->sys_priority = sys_priority; lacp->active = active; + lacp->fast = fast; } /* Processes 'pdu', a parsed LACP packet received on 'slave_'. This function @@ -149,7 +151,9 @@ lacp_process_pdu(struct lacp *lacp, const void *slave_, struct slave *slave = slave_lookup(lacp, slave_); slave->status = LACP_CURRENT; - slave->rx = time_msec() + LACP_SLOW_TIME_RX; + slave->rx = time_msec() + (lacp->fast + ? LACP_FAST_TIME_RX + : LACP_SLOW_TIME_RX); slave->ntt_actor = pdu->partner; @@ -431,6 +435,10 @@ slave_get_actor(struct slave *slave, struct lacp_info *actor) state |= LACP_STATE_ACT; } + if (slave->lacp->fast) { + state |= LACP_STATE_TIME; + } + if (slave->attached) { state |= LACP_STATE_SYNC; } |