[ovs-dev] [PATCH 2/3] bond: Remove stable bond mode.

Ben Pfaff blp at nicira.com
Tue Feb 5 16:52:39 UTC 2013

On Mon, Feb 04, 2013 at 07:13:35PM -0800, Ethan Jackson wrote:
> Stable bond mode, along with autopath, were trying to implement
> functionality close to what we get from the bundle action.
> Unfortunately, they are quite clunky, and generally less useful
> than bundle, so they're being removed.
> Signed-off-by: Ethan Jackson <ethan at nicira.com>

The comment on the function now called choose_hash_slave() seems rather
shrill.  I don't think the performance is an issue.

choose_hash_slave() is now just trying to choose a random slave, right?
Then we can use a simpler algorithm that doesn't need any extra input:

/* Randomly chooses and returns an enabled slave.  Returns NULL if no slave is
 * enabled. */
static struct bond_slave *
choose_random_slave(const struct bond *bond)
    struct bond_slave *best, *slave;
    int n;

    n = 0;
    best = NULL;
    HMAP_FOR_EACH (slave, hmap_node, &bond->slaves) {
        if (slave->enabled && !random_range(++n)) {
            best = slave;

    return best;



More information about the dev mailing list