[ovs-dev] [lacp bridge 3/4] bond: Create new 'stable_id' parameter.
ethan at nicira.com
Fri Apr 15 18:15:28 UTC 2011
On Fri, Apr 15, 2011 at 10:38 AM, Ben Pfaff <blp at nicira.com> wrote:
> On Thu, Apr 14, 2011 at 07:09:37PM -0700, Ethan Jackson wrote:
>> For BM_STABLE bonds, instead of choosing the sort key in the
>> qsort() comparator. This patch makes it a configuration setting of
>> each slave. This will help rest LACP out of the bonding code
>> further in future patches.
> "rest"? Do you mean "wrest"? Or maybe just "pull".
I meant wrest, I'll fix that.
> In bond_slave_register(), if the slave is enabled and stb_id changes,
> then we need to set bond->stb_need_sort, I think, and probably
> revalidate everything too?
It's sufficient to set the need_sort flag because bond_run()
revalidates all flows if set.
> I would personally find bond_stb_sort_cmp__() more readable as:
> static int
> bond_stb_sort_cmp__(const void *a_, const void *b_)
> const struct bond_slave *const *ap = a_;
> const struct bond_slave *const *bp = b_;
> const struct bond_slave *a = *ap;
> const struct bond_slave *b = *bp;
> uint16_t a_id = a->stb_id;
> uint16_t b_id = b->stb_id;
> return a_id < b_id ? -1 : a_id > b_id;
I changed it to this style.
More information about the dev