From: Ethan Jackson Date: Thu, 5 May 2011 23:01:11 +0000 (-0700) Subject: bond: Create new "bond-stable-id". X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=632e2b95c94099b78a1a3550b865898704bc8b97;p=openvswitch bond: Create new "bond-stable-id". Stable bonding mode needs an ID to guarantee consistent slave selection decisions across ovs-vswitchd instances. Before this patch, we used the lacp-port-id for this purpose. However, LACP places restrictions on how lacp-port-ids can be allocated which may be inconvenient. This patch creates a special purpose bond-stable-id other_config setting which allows users to tweak this value directly. --- diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index b2dc55fb..09fc37d0 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -3288,9 +3288,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); } diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema index c5255dd9..56c77ac6 100644 --- a/vswitchd/vswitch.ovsschema +++ b/vswitchd/vswitch.ovsschema @@ -1,6 +1,6 @@ {"name": "Open_vSwitch", - "version": "3.4.0", - "cksum": "3926696578 15276", + "version": "3.4.1", + "cksum": "7815264 15276", "tables": { "Open_vSwitch": { "columns": { diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index 1db89dc5..0f455000 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -538,10 +538,10 @@ balancing is done. Uses a similar hashing strategy to balance-tcp, falling back to balance-slb style hashing when LACP negotiations are unsuccessful.

-

Slave selection decisions are made based on LACP port ID when LACP - negotiations are successful, falling back to openflow port number - when unsuccessful. Thus, decisions are consistent across all - ovs-vswitchd instances with equivalent port IDs.

+

Slave selection decisions are made based on + bond-stable-id if set. Otherwise, OpenFlow port + number is used. Decisions are consistent across all ovs-vswitchd + instances with equivalent bond-stable-ids.

@@ -1327,6 +1327,13 @@ Key-value pairs for rarely used interface features.
+
bond-stable-id
+
A positive integer using in stable bond mode to + make slave selection decisions. Allocating + bond-stable-ids consistently across interfaces + participating in a bond will guarantee consistent slave selection + decisions across ovs-vswitchd instances when using + stable bonding mode.
lacp-port-id
The LACP port ID of this . Port IDs are used in LACP negotiations to identify individual ports