X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Flacp.c;h=25416230d4a555e7689a78e4b473e59ac0866b8c;hb=332e0d030b522828b6b93152f860c2bc08bfbbf8;hp=de860e0d96c9f795e413d2cbb2a1f920153d5e8d;hpb=77fdfa9bf71aff101219b249955842f6dc59b5c9;p=openvswitch diff --git a/lib/lacp.c b/lib/lacp.c index de860e0d..25416230 100644 --- a/lib/lacp.c +++ b/lib/lacp.c @@ -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; }