[ovs-dev] [consistent 2/2] bond: BM_STABLE consistent hashing.

Ethan Jackson ethan at nicira.com
Thu Apr 21 16:07:29 UTC 2011


> +static struct bond_slave *
> +choose_stb_slave(const struct bond *bond, const struct flow *flow,
> +                 uint16_t vlan)
> +{
> +    struct bond_slave *best, *slave;
> +    uint32_t best_hash;
> +
> +    best = NULL;
> +    best_hash = 0;
> +    HMAP_FOR_EACH (slave, hmap_node, &bond->slaves) {
> +        if (slave->enabled) {
> +            uint32_t hash;
> +
> +            hash = hash_2words(bond_hash(bond, flow, vlan), slave->stb_id);

I realized as I fell asleep last night that I should pull this
bond_hash calculation out of the loop.  I'll do that before merging.



More information about the dev mailing list