Lines Matching refs:bond

137  * __get_first_agg - get the first aggregator in the bond
140 * Return the aggregator of the first slave in @bond, or %NULL if it can't be
146 struct bonding *bond = __get_bond_by_port(port);
150 /* If there's no bond for this port, or bond has no slaves */
151 if (bond == NULL)
155 first_slave = bond_first_slave_rcu(bond);
212 struct bonding *bond = __get_bond_by_port(port);
214 if (bond == NULL)
217 return bond->params.ad_select;
226 struct bonding *bond = __get_bond_by_port(port);
228 if (bond == NULL)
231 return atomic_read(&BOND_AD_INFO(bond).agg_select_timer) ? 1 : 0;
339 slave->bond->dev->name,
347 slave_dbg(slave->bond->dev, slave->dev, "Port %d Received link speed %d update from adapter\n",
372 slave_dbg(slave->bond->dev, slave->dev, "Port %d Received status full duplex update from adapter\n",
378 slave_dbg(slave->bond->dev, slave->dev, "Port %d Received status NOT full duplex update from adapter\n",
388 const struct bonding *bond = bond_get_bond_by_slave(port->slave);
390 port->actor_system = BOND_AD_INFO(bond).system.sys_mac_addr;
391 port->actor_system_priority = BOND_AD_INFO(bond).system.sys_priority;
513 slave_dbg(port->slave->bond->dev, port->slave->dev,
517 slave_dbg(port->slave->bond->dev, port->slave->dev,
780 struct bonding *bond = aggregator->slave->bond;
784 bond_for_each_slave_rcu(bond, slave, iter)
813 slave_dbg(port->slave->bond->dev, port->slave->dev,
861 atomic64_inc(&BOND_AD_INFO(slave->bond).stats.lacpdu_tx);
907 atomic64_inc(&BOND_AD_INFO(slave->bond).stats.marker_tx);
911 atomic64_inc(&BOND_AD_INFO(slave->bond).stats.marker_resp_tx);
1047 slave_dbg(port->slave->bond->dev, port->slave->dev,
1111 atomic64_inc(&BOND_AD_INFO(port->slave->bond).stats.lacpdu_rx);
1165 slave_dbg(port->slave->bond->dev, port->slave->dev,
1217 slave_err(port->slave->bond->dev, port->slave->dev, "An illegal loopback occurred on slave\n"
1287 slave_dbg(port->slave->bond->dev,
1308 * @bond_params: bond parameters we will use
1370 slave_dbg(port->slave->bond->dev, port->slave->dev,
1409 struct bonding *bond;
1417 bond = __get_bond_by_port(port);
1449 slave_dbg(bond->dev, port->slave->dev, "Port %d left LAG %d\n",
1465 port->slave->bond->dev->name,
1472 bond_for_each_slave(bond, slave, iter) {
1498 slave_dbg(bond->dev, slave->dev, "Port %d joined LAG %d (existing LAG)\n",
1545 slave_dbg(bond->dev, port->slave->dev, "Port %d joined LAG %d (new LAG)\n",
1549 slave_err(bond->dev, port->slave->dev,
1632 curr->slave->bond->dev->name,
1674 * set of slaves in the bond changes.
1678 * set of slaves in the bond changes.
1680 * FIXME: this function MUST be called with the first agg in the bond, or
1682 * called with the bond itself, and retrieve the first agg from it.
1688 struct bonding *bond = agg->slave->bond;
1698 bond_for_each_slave_rcu(bond, slave, iter) {
1734 netdev_dbg(bond->dev, "(slave %s): best Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n",
1740 netdev_dbg(bond->dev, "(slave %s): best ports %p slave %p\n",
1744 bond_for_each_slave_rcu(bond, slave, iter) {
1747 slave_dbg(bond->dev, slave->dev, "Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n",
1756 net_warn_ratelimited("%s: Warning: No 802.3ad response from the link partner for any adapters in the bond\n",
1757 bond->dev->name);
1760 netdev_dbg(bond->dev, "(slave %s): LAG %d chosen as the active LAG\n",
1763 netdev_dbg(bond->dev, "(slave %s): Agg=%d; P=%d; a k=%d; p k=%d; Ind=%d; Act=%d\n",
1800 bond_3ad_set_carrier(bond);
1920 slave_dbg(port->slave->bond->dev, port->slave->dev,
1941 slave_dbg(port->slave->bond->dev, port->slave->dev,
1962 atomic64_inc(&BOND_AD_INFO(port->slave->bond).stats.marker_rx);
1971 slave_dbg(port->slave->bond->dev, port->slave->dev,
1989 atomic64_inc(&BOND_AD_INFO(port->slave->bond).stats.marker_resp_rx);
2001 * @bond: bonding struct
2006 * any down to up transitions of the bond.
2008 void bond_3ad_initiate_agg_selection(struct bonding *bond, int timeout)
2010 atomic_set(&BOND_AD_INFO(bond).agg_select_timer, timeout);
2014 * bond_3ad_initialize - initialize a bond's 802.3ad parameters and structures
2015 * @bond: bonding struct to work on
2017 * Can be called only after the mac address of the bond is set.
2019 void bond_3ad_initialize(struct bonding *bond)
2021 BOND_AD_INFO(bond).aggregator_identifier = 0;
2022 BOND_AD_INFO(bond).system.sys_priority =
2023 bond->params.ad_actor_sys_prio;
2024 if (is_zero_ether_addr(bond->params.ad_actor_system))
2025 BOND_AD_INFO(bond).system.sys_mac_addr =
2026 *((struct mac_addr *)bond->dev->dev_addr);
2028 BOND_AD_INFO(bond).system.sys_mac_addr =
2029 *((struct mac_addr *)bond->params.ad_actor_system);
2031 bond_3ad_initiate_agg_selection(bond,
2045 struct bonding *bond = bond_get_bond_by_slave(slave);
2055 ad_initialize_port(port, bond->params.lacp_fast);
2062 port->actor_admin_port_key = bond->params.ad_user_port_key << 6;
2064 /* actor system is the bond's system */
2078 aggregator->aggregator_mac_address = *((struct mac_addr *)bond->dev->dev_addr);
2079 aggregator->aggregator_identifier = ++BOND_AD_INFO(bond).aggregator_identifier;
2099 struct bonding *bond = slave->bond;
2105 spin_lock_bh(&bond->mode_lock);
2111 slave_warn(bond->dev, slave->dev, "Trying to unbind an uninitialized port\n");
2115 slave_dbg(bond->dev, slave->dev, "Unbinding Link Aggregation Group %d\n",
2136 bond_for_each_slave(bond, slave_iter, iter) {
2154 slave_dbg(bond->dev, slave->dev, "Some port(s) related to LAG %d - replacing with LAG %d\n",
2160 slave_info(bond->dev, slave->dev, "Removing an active aggregator\n");
2191 slave_warn(bond->dev, slave->dev, "unbinding aggregator, and could not find a new aggregator for its ports\n");
2200 slave_info(bond->dev, slave->dev, "Removing an active aggregator\n");
2210 slave_dbg(bond->dev, slave->dev, "Unbinding port %d\n", port->actor_port_number);
2213 bond_for_each_slave(bond, slave_iter, iter) {
2234 slave_info(bond->dev, slave->dev, "Removing an active aggregator\n");
2247 spin_unlock_bh(&bond->mode_lock);
2252 * @bond: bonding struct to work on
2255 * settings so the bond device will use the new values when it gets upped.
2257 void bond_3ad_update_ad_actor_settings(struct bonding *bond)
2264 BOND_AD_INFO(bond).system.sys_priority = bond->params.ad_actor_sys_prio;
2265 if (is_zero_ether_addr(bond->params.ad_actor_system))
2266 BOND_AD_INFO(bond).system.sys_mac_addr =
2267 *((struct mac_addr *)bond->dev->dev_addr);
2269 BOND_AD_INFO(bond).system.sys_mac_addr =
2270 *((struct mac_addr *)bond->params.ad_actor_system);
2272 spin_lock_bh(&bond->mode_lock);
2273 bond_for_each_slave(bond, slave, iter) {
2279 spin_unlock_bh(&bond->mode_lock);
2284 * @bond: bonding structure
2288 static bool bond_agg_timer_advance(struct bonding *bond)
2293 val = atomic_read(&BOND_AD_INFO(bond).agg_select_timer);
2297 if (atomic_cmpxchg(&BOND_AD_INFO(bond).agg_select_timer,
2315 * related to any aggregator, and selects the active aggregator for a bond.
2319 struct bonding *bond = container_of(work, struct bonding,
2332 spin_lock_bh(&bond->mode_lock);
2336 if (!bond_has_slaves(bond))
2339 if (bond_agg_timer_advance(bond)) {
2340 slave = bond_first_slave_rcu(bond);
2343 /* select the active aggregator for the bond */
2346 net_warn_ratelimited("%s: Warning: bond's first port is uninitialized\n",
2347 bond->dev->name);
2354 bond_3ad_set_carrier(bond);
2358 bond_for_each_slave_rcu(bond, slave, iter) {
2362 bond->dev->name);
2367 ad_periodic_machine(port, &bond->params);
2379 bond_for_each_slave_rcu(bond, slave, iter) {
2386 spin_unlock_bh(&bond->mode_lock);
2389 bond_slave_arr_work_rearm(bond, 0);
2392 bond_slave_state_notify(bond);
2395 queue_delayed_work(bond->wq, &bond->ad_work, ad_delta_in_ticks);
2409 struct bonding *bond = slave->bond;
2418 slave->dev->name, slave->bond->dev->name);
2425 slave_dbg(slave->bond->dev, slave->dev,
2429 spin_lock(&slave->bond->mode_lock);
2431 spin_unlock(&slave->bond->mode_lock);
2441 slave_dbg(slave->bond->dev, slave->dev, "Received Marker Information on port %d\n",
2446 slave_dbg(slave->bond->dev, slave->dev, "Received Marker Response on port %d\n",
2451 slave_dbg(slave->bond->dev, slave->dev, "Received an unknown Marker subtype on port %d\n",
2455 stat = &BOND_AD_INFO(bond).stats.marker_unknown_rx;
2461 atomic64_inc(&BOND_AD_INFO(bond).stats.lacpdu_unknown_rx);
2502 slave_err(port->slave->bond->dev,
2530 slave_warn(slave->bond->dev, slave->dev,
2535 spin_lock_bh(&slave->bond->mode_lock);
2537 spin_unlock_bh(&slave->bond->mode_lock);
2538 slave_dbg(slave->bond->dev, slave->dev, "Port %d changed speed/duplex\n",
2559 slave_warn(slave->bond->dev, slave->dev, "link status changed for uninitialized port\n");
2563 spin_lock_bh(&slave->bond->mode_lock);
2582 spin_unlock_bh(&slave->bond->mode_lock);
2584 slave_dbg(slave->bond->dev, slave->dev, "Port %d changed link status to %s\n",
2591 bond_update_slave_arr(slave->bond, NULL);
2596 * @bond: bonding structure
2607 int bond_3ad_set_carrier(struct bonding *bond)
2614 first_slave = bond_first_slave_rcu(bond);
2622 if (__agg_active_ports(active) < bond->params.min_links) {
2623 if (netif_carrier_ok(bond->dev)) {
2624 netif_carrier_off(bond->dev);
2627 } else if (!netif_carrier_ok(bond->dev)) {
2628 netif_carrier_on(bond->dev);
2631 } else if (netif_carrier_ok(bond->dev)) {
2632 netif_carrier_off(bond->dev);
2641 * @bond: bonding struct to work on
2642 * @ad_info: ad_info struct to fill with the bond's info
2647 int __bond_3ad_get_active_agg_info(struct bonding *bond,
2655 bond_for_each_slave_rcu(bond, slave, iter) {
2675 int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info)
2680 ret = __bond_3ad_get_active_agg_info(bond, ad_info);
2686 int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond,
2700 atomic64_inc(&BOND_AD_INFO(bond).stats.lacpdu_illegal_rx);
2709 * @bond: bonding struct
2714 * Hold bond->mode_lock,
2716 * no matter bond is up or down.
2718 void bond_3ad_update_lacp_rate(struct bonding *bond)
2725 lacp_fast = bond->params.lacp_fast;
2726 spin_lock_bh(&bond->mode_lock);
2727 bond_for_each_slave(bond, slave, iter) {
2734 spin_unlock_bh(&bond->mode_lock);