Lines Matching full:best
1670 * the current best, according to the ad_select policy.
1672 static struct aggregator *ad_agg_selection_test(struct aggregator *best, in ad_agg_selection_test() argument
1675 /* 0. If no best, select current. in ad_agg_selection_test()
1677 * 1. If the current agg is not individual, and the best is in ad_agg_selection_test()
1680 * 2. If current agg is individual and the best is not, keep best. in ad_agg_selection_test()
1682 * 3. Therefore, current and best are both individual or both not in ad_agg_selection_test()
1685 * 3a. If current agg partner replied, and best agg partner did not, in ad_agg_selection_test()
1688 * 3b. If current agg partner did not reply and best agg partner in ad_agg_selection_test()
1689 * did reply, keep best. in ad_agg_selection_test()
1691 * 4. Therefore, current and best both have partner replies or in ad_agg_selection_test()
1699 if (!best) in ad_agg_selection_test()
1702 if (!curr->is_individual && best->is_individual) in ad_agg_selection_test()
1705 if (curr->is_individual && !best->is_individual) in ad_agg_selection_test()
1706 return best; in ad_agg_selection_test()
1708 if (__agg_has_partner(curr) && !__agg_has_partner(best)) in ad_agg_selection_test()
1711 if (!__agg_has_partner(curr) && __agg_has_partner(best)) in ad_agg_selection_test()
1712 return best; in ad_agg_selection_test()
1716 if (__agg_active_ports(curr) > __agg_active_ports(best)) in ad_agg_selection_test()
1719 if (__agg_active_ports(curr) < __agg_active_ports(best)) in ad_agg_selection_test()
1720 return best; in ad_agg_selection_test()
1725 if (__get_agg_bandwidth(curr) > __get_agg_bandwidth(best)) in ad_agg_selection_test()
1738 return best; in ad_agg_selection_test()
1787 struct aggregator *best, *active, *origin; in ad_agg_selection_logic() local
1796 best = (active && agg_device_up(active)) ? active : NULL; in ad_agg_selection_logic()
1804 best = ad_agg_selection_test(best, agg); in ad_agg_selection_logic()
1807 if (best && in ad_agg_selection_logic()
1808 __get_agg_selection_mode(best->lag_ports) == BOND_AD_STABLE) { in ad_agg_selection_logic()
1811 * partner) or if both the best and active don't have an in ad_agg_selection_logic()
1818 !__agg_has_partner(best)))) { in ad_agg_selection_logic()
1820 best->actor_oper_aggregator_key)) { in ad_agg_selection_logic()
1821 best = NULL; in ad_agg_selection_logic()
1827 if (best && (best == active)) { in ad_agg_selection_logic()
1828 best = NULL; in ad_agg_selection_logic()
1832 /* if there is new best aggregator, activate it */ in ad_agg_selection_logic()
1833 if (best) { in ad_agg_selection_logic()
1834 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()
1835 best->slave ? best->slave->dev->name : "NULL", in ad_agg_selection_logic()
1836 best->aggregator_identifier, best->num_of_ports, in ad_agg_selection_logic()
1837 best->actor_oper_aggregator_key, in ad_agg_selection_logic()
1838 best->partner_oper_aggregator_key, in ad_agg_selection_logic()
1839 best->is_individual, best->is_active); in ad_agg_selection_logic()
1840 netdev_dbg(bond->dev, "(slave %s): best ports %p slave %p\n", in ad_agg_selection_logic()
1841 best->slave ? best->slave->dev->name : "NULL", in ad_agg_selection_logic()
1842 best->lag_ports, best->slave); in ad_agg_selection_logic()
1855 if (best->is_individual) in ad_agg_selection_logic()
1859 best->is_active = 1; in ad_agg_selection_logic()
1861 best->slave ? best->slave->dev->name : "NULL", in ad_agg_selection_logic()
1862 best->aggregator_identifier); in ad_agg_selection_logic()
1864 best->slave ? best->slave->dev->name : "NULL", in ad_agg_selection_logic()
1865 best->aggregator_identifier, best->num_of_ports, in ad_agg_selection_logic()
1866 best->actor_oper_aggregator_key, in ad_agg_selection_logic()
1867 best->partner_oper_aggregator_key, in ad_agg_selection_logic()
1868 best->is_individual, best->is_active); in ad_agg_selection_logic()