X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=vswitchd%2Fbridge.c;h=d883596de83c0e129c088974516cd4554d6495d8;hb=cc8d12f9364760456c86e92378d529c0dd9aaa66;hp=dee19a9bbf699a063dc6000ded8c45204cb9349d;hpb=672d18b29644302efa9fbc42a88cde80237d6dd8;p=openvswitch diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index dee19a9b..d883596d 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -3136,11 +3136,13 @@ static void 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; @@ -3150,9 +3152,14 @@ iface_reconfigure_lacp(struct iface *iface) 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); } @@ -3189,9 +3196,9 @@ port_reconfigure_lacp(struct port *port) ? priority : UINT16_MAX - !list_is_short(&port->ifaces)); - s.strict = !strcmp(get_port_other_config(port->cfg, "lacp-strict", - "false"), - "true"); + s.heartbeat = !strcmp(get_port_other_config(port->cfg, + "lacp-heartbeat", + "false"), "true"); lacp_time = get_port_other_config(port->cfg, "lacp-time", "slow"); custom_time = atoi(lacp_time); @@ -3277,9 +3284,15 @@ port_reconfigure_bond(struct port *port) } LIST_FOR_EACH (iface, port_elem, &port->ifaces) { - uint16_t stable_id = (port->lacp - ? lacp_slave_get_port_id(port->lacp, iface) - : iface->dp_ifidx); + long long stable_id; + + stable_id = atoll(get_interface_other_config(iface->cfg, + "bond-stable-id", "0")); + + if (stable_id <= 0 || stable_id >= UINT32_MAX) { + stable_id = odp_port_to_ofp_port(iface->dp_ifidx); + } + bond_slave_register(iface->port->bond, iface, stable_id, iface->netdev); }