Lines Matching full:best
1539 * the current best, according to the ad_select policy.
1541 static struct aggregator *ad_agg_selection_test(struct aggregator *best, in ad_agg_selection_test() argument
1544 /* 0. If no best, select current. in ad_agg_selection_test()
1546 * 1. If the current agg is not individual, and the best is in ad_agg_selection_test()
1549 * 2. If current agg is individual and the best is not, keep best. in ad_agg_selection_test()
1551 * 3. Therefore, current and best are both individual or both not in ad_agg_selection_test()
1554 * 3a. If current agg partner replied, and best agg partner did not, in ad_agg_selection_test()
1557 * 3b. If current agg partner did not reply and best agg partner in ad_agg_selection_test()
1558 * did reply, keep best. in ad_agg_selection_test()
1560 * 4. Therefore, current and best both have partner replies or in ad_agg_selection_test()
1568 if (!best) in ad_agg_selection_test()
1571 if (!curr->is_individual && best->is_individual) in ad_agg_selection_test()
1574 if (curr->is_individual && !best->is_individual) in ad_agg_selection_test()
1575 return best; in ad_agg_selection_test()
1577 if (__agg_has_partner(curr) && !__agg_has_partner(best)) in ad_agg_selection_test()
1580 if (!__agg_has_partner(curr) && __agg_has_partner(best)) in ad_agg_selection_test()
1581 return best; in ad_agg_selection_test()
1585 if (__agg_active_ports(curr) > __agg_active_ports(best)) in ad_agg_selection_test()
1588 if (__agg_active_ports(curr) < __agg_active_ports(best)) in ad_agg_selection_test()
1589 return best; in ad_agg_selection_test()
1594 if (__get_agg_bandwidth(curr) > __get_agg_bandwidth(best)) in ad_agg_selection_test()
1607 return best; in ad_agg_selection_test()
1656 struct aggregator *best, *active, *origin; in ad_agg_selection_logic() local
1665 best = (active && agg_device_up(active)) ? active : NULL; in ad_agg_selection_logic()
1673 best = ad_agg_selection_test(best, agg); in ad_agg_selection_logic()
1676 if (best && in ad_agg_selection_logic()
1677 __get_agg_selection_mode(best->lag_ports) == BOND_AD_STABLE) { in ad_agg_selection_logic()
1680 * partner) or if both the best and active don't have an in ad_agg_selection_logic()
1687 !__agg_has_partner(best)))) { in ad_agg_selection_logic()
1689 best->actor_oper_aggregator_key)) { in ad_agg_selection_logic()
1690 best = NULL; in ad_agg_selection_logic()
1696 if (best && (best == active)) { in ad_agg_selection_logic()
1697 best = NULL; in ad_agg_selection_logic()
1701 /* if there is new best aggregator, activate it */ in ad_agg_selection_logic()
1702 if (best) { in ad_agg_selection_logic()
1703 netdev_dbg(bond->dev, "(slave %s): best Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n", in ad_agg_selection_logic()
1704 best->slave ? best->slave->dev->name : "NULL", in ad_agg_selection_logic()
1705 best->aggregator_identifier, best->num_of_ports, in ad_agg_selection_logic()
1706 best->actor_oper_aggregator_key, in ad_agg_selection_logic()
1707 best->partner_oper_aggregator_key, in ad_agg_selection_logic()
1708 best->is_individual, best->is_active); in ad_agg_selection_logic()
1709 netdev_dbg(bond->dev, "(slave %s): best ports %p slave %p\n", in ad_agg_selection_logic()
1710 best->slave ? best->slave->dev->name : "NULL", in ad_agg_selection_logic()
1711 best->lag_ports, best->slave); in ad_agg_selection_logic()
1724 if (best->is_individual) in ad_agg_selection_logic()
1728 best->is_active = 1; in ad_agg_selection_logic()
1730 best->slave ? best->slave->dev->name : "NULL", in ad_agg_selection_logic()
1731 best->aggregator_identifier); in ad_agg_selection_logic()
1733 best->slave ? best->slave->dev->name : "NULL", in ad_agg_selection_logic()
1734 best->aggregator_identifier, best->num_of_ports, in ad_agg_selection_logic()
1735 best->actor_oper_aggregator_key, in ad_agg_selection_logic()
1736 best->partner_oper_aggregator_key, in ad_agg_selection_logic()
1737 best->is_individual, best->is_active); in ad_agg_selection_logic()