projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bridge: Expire bond slave assignments when their loads decay to 0.
[openvswitch]
/
lib
/
lacp.c
diff --git
a/lib/lacp.c
b/lib/lacp.c
index de860e0d96c9f795e413d2cbb2a1f920153d5e8d..25416230d4a555e7689a78e4b473e59ac0866b8c 100644
(file)
--- 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. */
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. */
};
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,
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);
{
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;
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
}
/* 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;
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;
slave->ntt_actor = pdu->partner;
@@
-431,6
+435,10
@@
slave_get_actor(struct slave *slave, struct lacp_info *actor)
state |= LACP_STATE_ACT;
}
state |= LACP_STATE_ACT;
}
+ if (slave->lacp->fast) {
+ state |= LACP_STATE_TIME;
+ }
+
if (slave->attached) {
state |= LACP_STATE_SYNC;
}
if (slave->attached) {
state |= LACP_STATE_SYNC;
}