Lines Matching refs:best
1540 * the current best, according to the ad_select policy.
1542 static struct aggregator *ad_agg_selection_test(struct aggregator *best,
1545 /* 0. If no best, select current.
1547 * 1. If the current agg is not individual, and the best is
1550 * 2. If current agg is individual and the best is not, keep best.
1552 * 3. Therefore, current and best are both individual or both not
1555 * 3a. If current agg partner replied, and best agg partner did not,
1558 * 3b. If current agg partner did not reply and best agg partner
1559 * did reply, keep best.
1561 * 4. Therefore, current and best both have partner replies or
1569 if (!best)
1572 if (!curr->is_individual && best->is_individual)
1575 if (curr->is_individual && !best->is_individual)
1576 return best;
1578 if (__agg_has_partner(curr) && !__agg_has_partner(best))
1581 if (!__agg_has_partner(curr) && __agg_has_partner(best))
1582 return best;
1586 if (__agg_active_ports(curr) > __agg_active_ports(best))
1589 if (__agg_active_ports(curr) < __agg_active_ports(best))
1590 return best;
1595 if (__get_agg_bandwidth(curr) > __get_agg_bandwidth(best))
1608 return best;
1657 struct aggregator *best, *active, *origin;
1666 best = (active && agg_device_up(active)) ? active : NULL;
1674 best = ad_agg_selection_test(best, agg);
1677 if (best &&
1678 __get_agg_selection_mode(best->lag_ports) == BOND_AD_STABLE) {
1681 * partner) or if both the best and active don't have an
1688 !__agg_has_partner(best)))) {
1690 best->actor_oper_aggregator_key)) {
1691 best = NULL;
1697 if (best && (best == active)) {
1698 best = NULL;
1702 /* if there is new best aggregator, activate it */
1703 if (best) {
1704 netdev_dbg(bond->dev, "(slave %s): best Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n",
1705 best->slave ? best->slave->dev->name : "NULL",
1706 best->aggregator_identifier, best->num_of_ports,
1707 best->actor_oper_aggregator_key,
1708 best->partner_oper_aggregator_key,
1709 best->is_individual, best->is_active);
1710 netdev_dbg(bond->dev, "(slave %s): best ports %p slave %p\n",
1711 best->slave ? best->slave->dev->name : "NULL",
1712 best->lag_ports, best->slave);
1725 if (best->is_individual)
1729 best->is_active = 1;
1731 best->slave ? best->slave->dev->name : "NULL",
1732 best->aggregator_identifier);
1734 best->slave ? best->slave->dev->name : "NULL",
1735 best->aggregator_identifier, best->num_of_ports,
1736 best->actor_oper_aggregator_key,
1737 best->partner_oper_aggregator_key,
1738 best->is_individual, best->is_active);