struct lacp *lacp; /* LACP object containing this slave. */
uint16_t port_id; /* Port ID. */
uint16_t port_priority; /* Port Priority. */
+ uint16_t key; /* Aggregation Key. 0 if default. */
char *name; /* Name of this slave. */
enum slave_status status; /* Slave status. */
slave->name = xstrdup(s->name);
}
- if (slave->port_id != s->id || slave->port_priority != s->priority) {
+ if (slave->port_id != s->id
+ || slave->port_priority != s->priority
+ || slave->key != s->key) {
slave->port_id = s->id;
slave->port_priority = s->priority;
+ slave->key = s->key;
lacp->update = true;
slave_get_actor(struct slave *slave, struct lacp_info *actor)
{
struct lacp *lacp = slave->lacp;
+ uint16_t key;
uint8_t state = 0;
if (lacp->active) {
state |= LACP_STATE_COL | LACP_STATE_DIST;
}
+ key = lacp->key_slave->key;
+ if (!key) {
+ key = lacp->key_slave->port_id;
+ }
+
actor->state = state;
- actor->key = htons(lacp->key_slave->port_id);
+ actor->key = htons(key);
actor->port_priority = htons(slave->port_priority);
actor->port_id = htons(slave->port_id);
actor->sys_priority = htons(lacp->sys_priority);
char *name;
uint16_t id;
uint16_t priority;
+ uint16_t key;
};
void lacp_slave_register(struct lacp *, void *slave_,
iface_reconfigure_lacp(struct iface *iface)
{
struct lacp_slave_settings s;
- int priority, portid;
+ int priority, portid, key;
portid = atoi(get_interface_other_config(iface->cfg, "lacp-port-id", "0"));
priority = atoi(get_interface_other_config(iface->cfg,
"lacp-port-priority", "0"));
+ key = atoi(get_interface_other_config(iface->cfg, "lacp-aggregation-key",
+ "0"));
if (portid <= 0 || portid > UINT16_MAX) {
portid = iface->dp_ifidx;
priority = UINT16_MAX;
}
+ if (key < 0 || key > UINT16_MAX) {
+ key = 0;
+ }
+
s.name = iface->name;
s.id = portid;
s.priority = priority;
+ s.key = key;
lacp_slave_register(iface->port->lacp, iface, &s);
}
LACP negotiations <ref table="Interface"/>s with numerically lower
priorities are preferred for aggregation. Must be a number between
1 and 65535.</dd>
+ <dt><code>lacp-aggregation-key</code></dt>
+ <dd> The LACP aggregation key of this <ref table="Interface"/>.
+ <ref table="Interface"/>s with different aggregation keys may not
+ be active within a given <ref table="Port"/> at the same time. Must
+ be a number between 1 and 65535.</dd>
</dl>
</column>