Lines Matching refs:best

1570  * the current best, according to the ad_select policy.
1572 static struct aggregator *ad_agg_selection_test(struct aggregator *best,
1575 /* 0. If no best, select current.
1577 * 1. If the current agg is not individual, and the best is
1580 * 2. If current agg is individual and the best is not, keep best.
1582 * 3. Therefore, current and best are both individual or both not
1585 * 3a. If current agg partner replied, and best agg partner did not,
1588 * 3b. If current agg partner did not reply and best agg partner
1589 * did reply, keep best.
1591 * 4. Therefore, current and best both have partner replies or
1599 if (!best)
1602 if (!curr->is_individual && best->is_individual)
1605 if (curr->is_individual && !best->is_individual)
1606 return best;
1608 if (__agg_has_partner(curr) && !__agg_has_partner(best))
1611 if (!__agg_has_partner(curr) && __agg_has_partner(best))
1612 return best;
1616 if (__agg_active_ports(curr) > __agg_active_ports(best))
1619 if (__agg_active_ports(curr) < __agg_active_ports(best))
1620 return best;
1625 if (__get_agg_bandwidth(curr) > __get_agg_bandwidth(best))
1638 return best;
1687 struct aggregator *best, *active, *origin;
1696 best = (active && agg_device_up(active)) ? active : NULL;
1704 best = ad_agg_selection_test(best, agg);
1707 if (best &&
1708 __get_agg_selection_mode(best->lag_ports) == BOND_AD_STABLE) {
1711 * partner) or if both the best and active don't have an
1718 !__agg_has_partner(best)))) {
1720 best->actor_oper_aggregator_key)) {
1721 best = NULL;
1727 if (best && (best == active)) {
1728 best = NULL;
1732 /* if there is new best aggregator, activate it */
1733 if (best) {
1734 netdev_dbg(bond->dev, "(slave %s): best Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n",
1735 best->slave ? best->slave->dev->name : "NULL",
1736 best->aggregator_identifier, best->num_of_ports,
1737 best->actor_oper_aggregator_key,
1738 best->partner_oper_aggregator_key,
1739 best->is_individual, best->is_active);
1740 netdev_dbg(bond->dev, "(slave %s): best ports %p slave %p\n",
1741 best->slave ? best->slave->dev->name : "NULL",
1742 best->lag_ports, best->slave);
1755 if (best->is_individual)
1759 best->is_active = 1;
1761 best->slave ? best->slave->dev->name : "NULL",
1762 best->aggregator_identifier);
1764 best->slave ? best->slave->dev->name : "NULL",
1765 best->aggregator_identifier, best->num_of_ports,
1766 best->actor_oper_aggregator_key,
1767 best->partner_oper_aggregator_key,
1768 best->is_individual, best->is_active);