The enabled flag in the LACP module was only used to set the
Collecting and Distributing flags in the LACP protocol. It was
intended to be set by the bonding code to mimic its enabled flag.
The spec is relatively vague on the precise meaning of these flags,
and most implementations do something completely different with
them. For these reasons, it seems acceptable to remove the enabled
flag for the sake of simplicity. A slave is now Collecting and
Distributing if it is attached, or LACP couldn't be negotiated.
/* Update LACP. */
if (bond->lacp) {
/* Update LACP. */
if (bond->lacp) {
- HMAP_FOR_EACH (slave, hmap_node, &bond->slaves) {
- lacp_slave_enable(bond->lacp, slave, slave->enabled);
- }
-
lacp_run(bond->lacp, bond_send_pdu_cb);
}
lacp_run(bond->lacp, bond_send_pdu_cb);
}
enum slave_status status; /* Slave status. */
bool attached; /* Attached. Traffic may flow. */
enum slave_status status; /* Slave status. */
bool attached; /* Attached. Traffic may flow. */
- bool enabled; /* Enabled. Traffic is flowing. */
struct lacp_info partner; /* Partner information. */
struct lacp_info ntt_actor; /* Used to decide if we Need To Transmit. */
struct timer tx; /* Next message transmission timer. */
struct lacp_info partner; /* Partner information. */
struct lacp_info ntt_actor; /* Used to decide if we Need To Transmit. */
struct timer tx; /* Next message transmission timer. */
-/* Should be called regularly to indicate whether 'slave_' is enabled. An
- * enabled slave is allowed to send and receive traffic. Generally a slave
- * should not be enabled if its carrier is down, or lacp_slave_may_enable()
- * indicates it should not be enabled. */
-void
-lacp_slave_enable(struct lacp *lacp, void *slave_, bool enabled)
-{
- slave_lookup(lacp, slave_)->enabled = enabled;
-}
-
/* This function should be called whenever the carrier status of 'slave_' has
* changed. */
void
/* This function should be called whenever the carrier status of 'slave_' has
* changed. */
void
state |= LACP_STATE_AGG;
}
state |= LACP_STATE_AGG;
}
+ if (slave->attached || !slave->lacp->negotiated) {
state |= LACP_STATE_COL | LACP_STATE_DIST;
}
state |= LACP_STATE_COL | LACP_STATE_DIST;
}
- ds_put_format(&ds, "\nslave: %s: %s %s %s\n", slave->name, status,
- slave->attached ? "attached" : "detached",
- slave->enabled ? "enabled" : "disabled");
+ ds_put_format(&ds, "\nslave: %s: %s %s\n", slave->name, status,
+ slave->attached ? "attached" : "detached");
ds_put_format(&ds, "\tport_id: %u\n", slave->port_id);
ds_put_format(&ds, "\tport_priority: %u\n", slave->port_priority);
ds_put_format(&ds, "\tport_id: %u\n", slave->port_id);
ds_put_format(&ds, "\tport_priority: %u\n", slave->port_priority);
void lacp_slave_register(struct lacp *, void *slave_,
const struct lacp_slave_settings *);
void lacp_slave_unregister(struct lacp *, const void *slave);
void lacp_slave_register(struct lacp *, void *slave_,
const struct lacp_slave_settings *);
void lacp_slave_unregister(struct lacp *, const void *slave);
-void lacp_slave_enable(struct lacp *lacp, void *slave_, bool enabled);
void lacp_slave_carrier_changed(const struct lacp *, const void *slave);
bool lacp_slave_may_enable(const struct lacp *, const void *slave);
uint16_t lacp_slave_get_port_id(const struct lacp *, const void *slave);
void lacp_slave_carrier_changed(const struct lacp *, const void *slave);
bool lacp_slave_may_enable(const struct lacp *, const void *slave);
uint16_t lacp_slave_get_port_id(const struct lacp *, const void *slave);