bond: Create new "bond-stable-id".
authorEthan Jackson <ethan@nicira.com>
Thu, 5 May 2011 23:01:11 +0000 (16:01 -0700)
committerEthan Jackson <ethan@nicira.com>
Fri, 6 May 2011 20:48:41 +0000 (13:48 -0700)
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.

vswitchd/bridge.c
vswitchd/vswitch.ovsschema
vswitchd/vswitch.xml

index b2dc55f..09fc37d 100644 (file)
@@ -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);
     }
index c5255dd..56c77ac 100644 (file)
@@ -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": {
index 1db89dc..0f45500 100644 (file)
             balancing is done.  Uses a similar hashing strategy to
             <code>balance-tcp</code>, falling back to <code>balance-slb</code>
             style hashing when LACP negotiations are unsuccessful.</p>
-          <p>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.</p>
+          <p>Slave selection decisions are made based on
+            <code>bond-stable-id</code> if set.  Otherwise, OpenFlow port
+            number is used.  Decisions are consistent across all ovs-vswitchd
+            instances with equivalent <code>bond-stable-id</code>s.</p>
         </dd>
       </dl>
 
       <column name="other_config">
         Key-value pairs for rarely used interface features.
         <dl>
+          <dt><code>bond-stable-id</code></dt>
+          <dd> A positive integer using in <code>stable</code> bond mode to
+            make slave selection decisions.  Allocating
+            <code>bond-stable-id</code>s consistently across interfaces
+            participating in a bond will guarantee consistent slave selection
+            decisions across ovs-vswitchd instances when using
+            <code>stable</code> bonding mode.</dd>
           <dt><code>lacp-port-id</code></dt>
           <dd> The LACP port ID of this <ref table="Interface"/>.  Port IDs are
             used in LACP negotiations to identify individual ports