Lines Matching full:bond

3  * drivers/net/bond/bond_options.c - bonding options
20 static int bond_option_active_slave_set(struct bonding *bond,
22 static int bond_option_miimon_set(struct bonding *bond,
24 static int bond_option_updelay_set(struct bonding *bond,
26 static int bond_option_downdelay_set(struct bonding *bond,
28 static int bond_option_peer_notif_delay_set(struct bonding *bond,
30 static int bond_option_use_carrier_set(struct bonding *bond,
32 static int bond_option_arp_interval_set(struct bonding *bond,
34 static int bond_option_arp_ip_target_add(struct bonding *bond, __be32 target);
35 static int bond_option_arp_ip_target_rem(struct bonding *bond, __be32 target);
36 static int bond_option_arp_ip_targets_set(struct bonding *bond,
38 static int bond_option_ns_ip6_targets_set(struct bonding *bond,
40 static int bond_option_arp_validate_set(struct bonding *bond,
42 static int bond_option_arp_all_targets_set(struct bonding *bond,
44 static int bond_option_prio_set(struct bonding *bond,
46 static int bond_option_primary_set(struct bonding *bond,
48 static int bond_option_primary_reselect_set(struct bonding *bond,
50 static int bond_option_fail_over_mac_set(struct bonding *bond,
52 static int bond_option_xmit_hash_policy_set(struct bonding *bond,
54 static int bond_option_resend_igmp_set(struct bonding *bond,
56 static int bond_option_num_peer_notif_set(struct bonding *bond,
58 static int bond_option_all_slaves_active_set(struct bonding *bond,
60 static int bond_option_min_links_set(struct bonding *bond,
62 static int bond_option_lp_interval_set(struct bonding *bond,
64 static int bond_option_pps_set(struct bonding *bond,
66 static int bond_option_lacp_active_set(struct bonding *bond,
68 static int bond_option_lacp_rate_set(struct bonding *bond,
70 static int bond_option_ad_select_set(struct bonding *bond,
72 static int bond_option_queue_id_set(struct bonding *bond,
74 static int bond_option_mode_set(struct bonding *bond,
76 static int bond_option_slaves_set(struct bonding *bond,
78 static int bond_option_tlb_dynamic_lb_set(struct bonding *bond,
80 static int bond_option_ad_actor_sys_prio_set(struct bonding *bond,
82 static int bond_option_ad_actor_system_set(struct bonding *bond,
84 static int bond_option_ad_user_port_key_set(struct bonding *bond,
86 static int bond_option_missed_max_set(struct bonding *bond,
88 static int bond_option_coupled_control_set(struct bonding *bond,
247 .desc = "bond device mode",
653 /* Check opt's dependencies against bond mode and currently set options */
654 static int bond_opt_check_deps(struct bonding *bond, in bond_opt_check_deps() argument
657 struct bond_params *params = &bond->params; in bond_opt_check_deps()
661 if ((opt->flags & BOND_OPTFLAG_NOSLAVES) && bond_has_slaves(bond)) in bond_opt_check_deps()
663 if ((opt->flags & BOND_OPTFLAG_IFDOWN) && (bond->dev->flags & IFF_UP)) in bond_opt_check_deps()
669 static void bond_opt_dep_print(struct bonding *bond, in bond_opt_dep_print() argument
677 params = &bond->params; in bond_opt_dep_print()
680 netdev_err(bond->dev, "option %s: mode dependency failed, not supported in mode %s(%llu)\n", in bond_opt_dep_print()
687 static void bond_opt_error_interpret(struct bonding *bond, in bond_opt_error_interpret() argument
705 netdev_err(bond->dev, "option %s: invalid value (%s)\n", in bond_opt_error_interpret()
708 netdev_err(bond->dev, "option %s: invalid value (%llu)\n", in bond_opt_error_interpret()
716 netdev_err(bond->dev, "option %s: allowed values %llu - %llu\n", in bond_opt_error_interpret()
720 bond_opt_dep_print(bond, opt, bad_attr, extack); in bond_opt_error_interpret()
724 "unable to set option because the bond device has slaves"); in bond_opt_error_interpret()
725 netdev_err(bond->dev, "option %s: unable to set because the bond device has slaves\n", in bond_opt_error_interpret()
730 "unable to set option because the bond is up"); in bond_opt_error_interpret()
731 netdev_err(bond->dev, "option %s: unable to set because the bond device is up\n", in bond_opt_error_interpret()
739 netdev_err(bond->dev, "option %s: interface %s does not exist!\n", in bond_opt_error_interpret()
752 * @bond: target bond device
759 * This function is used to change the bond's option value, it can be
763 int __bond_opt_set(struct bonding *bond, in __bond_opt_set() argument
776 ret = bond_opt_check_deps(bond, opt); in __bond_opt_set()
784 ret = opt->set(bond, retval); in __bond_opt_set()
787 bond_opt_error_interpret(bond, opt, ret, val, bad_attr, extack); in __bond_opt_set()
793 * @bond: target bond device
797 * This function is used to change the bond's option value and trigger
802 int __bond_opt_set_notify(struct bonding *bond, in __bond_opt_set_notify() argument
809 ret = __bond_opt_set(bond, option, val, NULL, NULL); in __bond_opt_set_notify()
811 if (!ret && (bond->dev->reg_state == NETREG_REGISTERED)) in __bond_opt_set_notify()
812 call_netdevice_notifiers(NETDEV_CHANGEINFODATA, bond->dev); in __bond_opt_set_notify()
819 * @bond: target bond device
826 int bond_opt_tryset_rtnl(struct bonding *bond, unsigned int option, char *buf) in bond_opt_tryset_rtnl() argument
834 ret = __bond_opt_set_notify(bond, option, &optval); in bond_opt_tryset_rtnl()
855 static bool bond_set_xfrm_features(struct bonding *bond) in bond_set_xfrm_features() argument
860 if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP) in bond_set_xfrm_features()
861 bond->dev->wanted_features |= BOND_XFRM_FEATURES; in bond_set_xfrm_features()
863 bond->dev->wanted_features &= ~BOND_XFRM_FEATURES; in bond_set_xfrm_features()
868 static int bond_option_mode_set(struct bonding *bond, in bond_option_mode_set() argument
871 if (bond->xdp_prog && !bond_xdp_check(bond, newval->value)) in bond_option_mode_set()
875 if (bond->params.arp_interval) { in bond_option_mode_set()
876 netdev_dbg(bond->dev, "%s mode is incompatible with arp monitoring, start mii monitoring\n", in bond_option_mode_set()
879 bond->params.arp_interval = 0; in bond_option_mode_set()
882 if (!bond->params.miimon) { in bond_option_mode_set()
884 bond->params.miimon = BOND_DEFAULT_MIIMON; in bond_option_mode_set()
885 netdev_dbg(bond->dev, "Setting MII monitoring interval to %d\n", in bond_option_mode_set()
886 bond->params.miimon); in bond_option_mode_set()
891 bond->params.tlb_dynamic_lb = 1; in bond_option_mode_set()
894 bond->params.arp_validate = BOND_ARP_VALIDATE_NONE; in bond_option_mode_set()
895 bond->params.mode = newval->value; in bond_option_mode_set()
897 if (bond->dev->reg_state == NETREG_REGISTERED) { in bond_option_mode_set()
900 update |= bond_set_xfrm_features(bond); in bond_option_mode_set()
903 netdev_update_features(bond->dev); in bond_option_mode_set()
906 bond_xdp_set_features(bond->dev); in bond_option_mode_set()
911 static int bond_option_active_slave_set(struct bonding *bond, in bond_option_active_slave_set() argument
922 slave_dev = __dev_get_by_name(dev_net(bond->dev), ifname); in bond_option_active_slave_set()
929 slave_err(bond->dev, slave_dev, "Device is not bonding slave\n"); in bond_option_active_slave_set()
933 if (bond->dev != netdev_master_upper_dev_get(slave_dev)) { in bond_option_active_slave_set()
934 slave_err(bond->dev, slave_dev, "Device is not our slave\n"); in bond_option_active_slave_set()
942 netdev_dbg(bond->dev, "Clearing current active slave\n"); in bond_option_active_slave_set()
943 bond_change_active_slave(bond, NULL); in bond_option_active_slave_set()
944 bond_select_active_slave(bond); in bond_option_active_slave_set()
946 struct slave *old_active = rtnl_dereference(bond->curr_active_slave); in bond_option_active_slave_set()
953 slave_dbg(bond->dev, new_active->dev, "is already the current active slave\n"); in bond_option_active_slave_set()
957 slave_dbg(bond->dev, new_active->dev, "Setting as active slave\n"); in bond_option_active_slave_set()
958 bond_change_active_slave(bond, new_active); in bond_option_active_slave_set()
960 …slave_err(bond->dev, new_active->dev, "Could not set as active slave; either %s is down or the lin… in bond_option_active_slave_set()
975 static int bond_option_miimon_set(struct bonding *bond, in bond_option_miimon_set() argument
978 netdev_dbg(bond->dev, "Setting MII monitoring interval to %llu\n", in bond_option_miimon_set()
980 bond->params.miimon = newval->value; in bond_option_miimon_set()
981 if (bond->params.updelay) in bond_option_miimon_set()
982 …netdev_dbg(bond->dev, "Note: Updating updelay (to %d) since it is a multiple of the miimon value\n… in bond_option_miimon_set()
983 bond->params.updelay * bond->params.miimon); in bond_option_miimon_set()
984 if (bond->params.downdelay) in bond_option_miimon_set()
985 …netdev_dbg(bond->dev, "Note: Updating downdelay (to %d) since it is a multiple of the miimon value… in bond_option_miimon_set()
986 bond->params.downdelay * bond->params.miimon); in bond_option_miimon_set()
987 if (bond->params.peer_notif_delay) in bond_option_miimon_set()
988 …netdev_dbg(bond->dev, "Note: Updating peer_notif_delay (to %d) since it is a multiple of the miimo… in bond_option_miimon_set()
989 bond->params.peer_notif_delay * bond->params.miimon); in bond_option_miimon_set()
990 if (newval->value && bond->params.arp_interval) { in bond_option_miimon_set()
991 …netdev_dbg(bond->dev, "MII monitoring cannot be used with ARP monitoring - disabling ARP monitorin… in bond_option_miimon_set()
992 bond->params.arp_interval = 0; in bond_option_miimon_set()
993 if (bond->params.arp_validate) in bond_option_miimon_set()
994 bond->params.arp_validate = BOND_ARP_VALIDATE_NONE; in bond_option_miimon_set()
996 if (bond->dev->flags & IFF_UP) { in bond_option_miimon_set()
1003 cancel_delayed_work_sync(&bond->mii_work); in bond_option_miimon_set()
1005 cancel_delayed_work_sync(&bond->arp_work); in bond_option_miimon_set()
1006 queue_delayed_work(bond->wq, &bond->mii_work, 0); in bond_option_miimon_set()
1017 static int _bond_option_delay_set(struct bonding *bond, in _bond_option_delay_set() argument
1024 if (!bond->params.miimon) { in _bond_option_delay_set()
1025 netdev_err(bond->dev, "Unable to set %s as MII monitoring is disabled\n", in _bond_option_delay_set()
1029 if ((value % bond->params.miimon) != 0) { in _bond_option_delay_set()
1030 netdev_warn(bond->dev, in _bond_option_delay_set()
1033 value, bond->params.miimon, in _bond_option_delay_set()
1034 (value / bond->params.miimon) * in _bond_option_delay_set()
1035 bond->params.miimon); in _bond_option_delay_set()
1037 *target = value / bond->params.miimon; in _bond_option_delay_set()
1038 netdev_dbg(bond->dev, "Setting %s to %d\n", in _bond_option_delay_set()
1040 *target * bond->params.miimon); in _bond_option_delay_set()
1045 static int bond_option_updelay_set(struct bonding *bond, in bond_option_updelay_set() argument
1048 return _bond_option_delay_set(bond, newval, "up delay", in bond_option_updelay_set()
1049 &bond->params.updelay); in bond_option_updelay_set()
1052 static int bond_option_downdelay_set(struct bonding *bond, in bond_option_downdelay_set() argument
1055 return _bond_option_delay_set(bond, newval, "down delay", in bond_option_downdelay_set()
1056 &bond->params.downdelay); in bond_option_downdelay_set()
1059 static int bond_option_peer_notif_delay_set(struct bonding *bond, in bond_option_peer_notif_delay_set() argument
1062 int ret = _bond_option_delay_set(bond, newval, in bond_option_peer_notif_delay_set()
1064 &bond->params.peer_notif_delay); in bond_option_peer_notif_delay_set()
1068 static int bond_option_use_carrier_set(struct bonding *bond, in bond_option_use_carrier_set() argument
1071 netdev_dbg(bond->dev, "Setting use_carrier to %llu\n", in bond_option_use_carrier_set()
1073 bond->params.use_carrier = newval->value; in bond_option_use_carrier_set()
1082 static int bond_option_arp_interval_set(struct bonding *bond, in bond_option_arp_interval_set() argument
1085 netdev_dbg(bond->dev, "Setting ARP monitoring interval to %llu\n", in bond_option_arp_interval_set()
1087 bond->params.arp_interval = newval->value; in bond_option_arp_interval_set()
1089 if (bond->params.miimon) { in bond_option_arp_interval_set()
1090 …netdev_dbg(bond->dev, "ARP monitoring cannot be used with MII monitoring. Disabling MII monitoring… in bond_option_arp_interval_set()
1091 bond->params.miimon = 0; in bond_option_arp_interval_set()
1093 if (!bond->params.arp_targets[0]) in bond_option_arp_interval_set()
1094 … netdev_dbg(bond->dev, "ARP monitoring has been set up, but no ARP targets have been specified\n"); in bond_option_arp_interval_set()
1096 if (bond->dev->flags & IFF_UP) { in bond_option_arp_interval_set()
1103 if (bond->params.arp_validate) in bond_option_arp_interval_set()
1104 bond->recv_probe = NULL; in bond_option_arp_interval_set()
1105 cancel_delayed_work_sync(&bond->arp_work); in bond_option_arp_interval_set()
1108 bond->recv_probe = bond_rcv_validate; in bond_option_arp_interval_set()
1109 cancel_delayed_work_sync(&bond->mii_work); in bond_option_arp_interval_set()
1110 queue_delayed_work(bond->wq, &bond->arp_work, 0); in bond_option_arp_interval_set()
1117 static void _bond_options_arp_ip_target_set(struct bonding *bond, int slot, in _bond_options_arp_ip_target_set() argument
1121 __be32 *targets = bond->params.arp_targets; in _bond_options_arp_ip_target_set()
1126 bond_for_each_slave(bond, slave, iter) in _bond_options_arp_ip_target_set()
1132 static int _bond_option_arp_ip_target_add(struct bonding *bond, __be32 target) in _bond_option_arp_ip_target_add() argument
1134 __be32 *targets = bond->params.arp_targets; in _bond_option_arp_ip_target_add()
1138 netdev_err(bond->dev, "invalid ARP target %pI4 specified for addition\n", in _bond_option_arp_ip_target_add()
1144 netdev_err(bond->dev, "ARP target %pI4 is already present\n", in _bond_option_arp_ip_target_add()
1151 netdev_err(bond->dev, "ARP target table is full!\n"); in _bond_option_arp_ip_target_add()
1155 netdev_dbg(bond->dev, "Adding ARP target %pI4\n", &target); in _bond_option_arp_ip_target_add()
1157 _bond_options_arp_ip_target_set(bond, ind, target, jiffies); in _bond_option_arp_ip_target_add()
1162 static int bond_option_arp_ip_target_add(struct bonding *bond, __be32 target) in bond_option_arp_ip_target_add() argument
1164 return _bond_option_arp_ip_target_add(bond, target); in bond_option_arp_ip_target_add()
1167 static int bond_option_arp_ip_target_rem(struct bonding *bond, __be32 target) in bond_option_arp_ip_target_rem() argument
1169 __be32 *targets = bond->params.arp_targets; in bond_option_arp_ip_target_rem()
1176 netdev_err(bond->dev, "invalid ARP target %pI4 specified for removal\n", in bond_option_arp_ip_target_rem()
1183 netdev_err(bond->dev, "unable to remove nonexistent ARP target %pI4\n", in bond_option_arp_ip_target_rem()
1188 if (ind == 0 && !targets[1] && bond->params.arp_interval) in bond_option_arp_ip_target_rem()
1189 netdev_warn(bond->dev, "Removing last arp target with arp_interval on\n"); in bond_option_arp_ip_target_rem()
1191 netdev_dbg(bond->dev, "Removing ARP target %pI4\n", &target); in bond_option_arp_ip_target_rem()
1193 bond_for_each_slave(bond, slave, iter) { in bond_option_arp_ip_target_rem()
1206 void bond_option_arp_ip_targets_clear(struct bonding *bond) in bond_option_arp_ip_targets_clear() argument
1211 _bond_options_arp_ip_target_set(bond, i, 0, 0); in bond_option_arp_ip_targets_clear()
1214 static int bond_option_arp_ip_targets_set(struct bonding *bond, in bond_option_arp_ip_targets_set() argument
1223 netdev_err(bond->dev, "invalid ARP target specified\n"); in bond_option_arp_ip_targets_set()
1227 ret = bond_option_arp_ip_target_add(bond, target); in bond_option_arp_ip_targets_set()
1229 ret = bond_option_arp_ip_target_rem(bond, target); in bond_option_arp_ip_targets_set()
1231 netdev_err(bond->dev, "no command found in arp_ip_targets file - use +<addr> or -<addr>\n"); in bond_option_arp_ip_targets_set()
1234 ret = bond_option_arp_ip_target_add(bond, target); in bond_option_arp_ip_targets_set()
1241 static bool slave_can_set_ns_maddr(const struct bonding *bond, struct slave *slave) in slave_can_set_ns_maddr() argument
1243 return BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP && in slave_can_set_ns_maddr()
1250 * @bond: bond device
1265 static void slave_set_ns_maddrs(struct bonding *bond, struct slave *slave, bool add) in slave_set_ns_maddrs() argument
1267 struct in6_addr *targets = bond->params.ns_targets; in slave_set_ns_maddrs()
1272 if (!slave_can_set_ns_maddr(bond, slave)) in slave_set_ns_maddrs()
1289 void bond_slave_ns_maddrs_add(struct bonding *bond, struct slave *slave) in bond_slave_ns_maddrs_add() argument
1291 if (!bond->params.arp_validate) in bond_slave_ns_maddrs_add()
1293 slave_set_ns_maddrs(bond, slave, true); in bond_slave_ns_maddrs_add()
1296 void bond_slave_ns_maddrs_del(struct bonding *bond, struct slave *slave) in bond_slave_ns_maddrs_del() argument
1298 if (!bond->params.arp_validate) in bond_slave_ns_maddrs_del()
1300 slave_set_ns_maddrs(bond, slave, false); in bond_slave_ns_maddrs_del()
1305 * @bond: bond device
1320 static void slave_set_ns_maddr(struct bonding *bond, struct slave *slave, in slave_set_ns_maddr() argument
1326 if (!bond->params.arp_validate || !slave_can_set_ns_maddr(bond, slave)) in slave_set_ns_maddr()
1342 static void _bond_options_ns_ip6_target_set(struct bonding *bond, int slot, in _bond_options_ns_ip6_target_set() argument
1346 struct in6_addr *targets = bond->params.ns_targets; in _bond_options_ns_ip6_target_set()
1351 bond_for_each_slave(bond, slave, iter) { in _bond_options_ns_ip6_target_set()
1353 slave_set_ns_maddr(bond, slave, target, &targets[slot]); in _bond_options_ns_ip6_target_set()
1359 void bond_option_ns_ip6_targets_clear(struct bonding *bond) in bond_option_ns_ip6_targets_clear() argument
1365 _bond_options_ns_ip6_target_set(bond, i, &addr_any, 0); in bond_option_ns_ip6_targets_clear()
1368 static int bond_option_ns_ip6_targets_set(struct bonding *bond, in bond_option_ns_ip6_targets_set() argument
1372 struct in6_addr *targets = bond->params.ns_targets; in bond_option_ns_ip6_targets_set()
1377 netdev_err(bond->dev, "invalid NS target %pI6c specified for addition\n", in bond_option_ns_ip6_targets_set()
1383 netdev_err(bond->dev, "NS target %pI6c is already present\n", in bond_option_ns_ip6_targets_set()
1390 netdev_err(bond->dev, "NS target table is full!\n"); in bond_option_ns_ip6_targets_set()
1394 netdev_dbg(bond->dev, "Adding NS target %pI6c\n", target); in bond_option_ns_ip6_targets_set()
1396 _bond_options_ns_ip6_target_set(bond, index, target, jiffies); in bond_option_ns_ip6_targets_set()
1401 static int bond_option_ns_ip6_targets_set(struct bonding *bond, in bond_option_ns_ip6_targets_set() argument
1407 static void slave_set_ns_maddrs(struct bonding *bond, struct slave *slave, bool add) {} in slave_set_ns_maddrs() argument
1409 void bond_slave_ns_maddrs_add(struct bonding *bond, struct slave *slave) {} in bond_slave_ns_maddrs_add() argument
1411 void bond_slave_ns_maddrs_del(struct bonding *bond, struct slave *slave) {} in bond_slave_ns_maddrs_del() argument
1414 static int bond_option_arp_validate_set(struct bonding *bond, in bond_option_arp_validate_set() argument
1417 bool changed = !!bond->params.arp_validate != !!newval->value; in bond_option_arp_validate_set()
1421 netdev_dbg(bond->dev, "Setting arp_validate to %s (%llu)\n", in bond_option_arp_validate_set()
1423 bond->params.arp_validate = newval->value; in bond_option_arp_validate_set()
1426 bond_for_each_slave(bond, slave, iter) in bond_option_arp_validate_set()
1427 slave_set_ns_maddrs(bond, slave, !!bond->params.arp_validate); in bond_option_arp_validate_set()
1433 static int bond_option_arp_all_targets_set(struct bonding *bond, in bond_option_arp_all_targets_set() argument
1436 netdev_dbg(bond->dev, "Setting arp_all_targets to %s (%llu)\n", in bond_option_arp_all_targets_set()
1438 bond->params.arp_all_targets = newval->value; in bond_option_arp_all_targets_set()
1443 static int bond_option_missed_max_set(struct bonding *bond, in bond_option_missed_max_set() argument
1446 netdev_dbg(bond->dev, "Setting missed max to %s (%llu)\n", in bond_option_missed_max_set()
1448 bond->params.missed_max = newval->value; in bond_option_missed_max_set()
1453 static int bond_option_prio_set(struct bonding *bond, in bond_option_prio_set() argument
1465 if (rtnl_dereference(bond->primary_slave)) in bond_option_prio_set()
1466 slave_warn(bond->dev, slave->dev, in bond_option_prio_set()
1469 bond_select_active_slave(bond); in bond_option_prio_set()
1474 static int bond_option_primary_set(struct bonding *bond, in bond_option_primary_set() argument
1488 netdev_dbg(bond->dev, "Setting primary slave to None\n"); in bond_option_primary_set()
1489 RCU_INIT_POINTER(bond->primary_slave, NULL); in bond_option_primary_set()
1490 memset(bond->params.primary, 0, sizeof(bond->params.primary)); in bond_option_primary_set()
1491 bond_select_active_slave(bond); in bond_option_primary_set()
1495 bond_for_each_slave(bond, slave, iter) { in bond_option_primary_set()
1497 slave_dbg(bond->dev, slave->dev, "Setting as primary slave\n"); in bond_option_primary_set()
1498 rcu_assign_pointer(bond->primary_slave, slave); in bond_option_primary_set()
1499 strcpy(bond->params.primary, slave->dev->name); in bond_option_primary_set()
1500 bond->force_primary = true; in bond_option_primary_set()
1501 bond_select_active_slave(bond); in bond_option_primary_set()
1506 if (rtnl_dereference(bond->primary_slave)) { in bond_option_primary_set()
1507 netdev_dbg(bond->dev, "Setting primary slave to None\n"); in bond_option_primary_set()
1508 RCU_INIT_POINTER(bond->primary_slave, NULL); in bond_option_primary_set()
1509 bond_select_active_slave(bond); in bond_option_primary_set()
1511 strscpy_pad(bond->params.primary, primary, IFNAMSIZ); in bond_option_primary_set()
1513 netdev_dbg(bond->dev, "Recording %s as primary, but it has not been enslaved yet\n", in bond_option_primary_set()
1522 static int bond_option_primary_reselect_set(struct bonding *bond, in bond_option_primary_reselect_set() argument
1525 netdev_dbg(bond->dev, "Setting primary_reselect to %s (%llu)\n", in bond_option_primary_reselect_set()
1527 bond->params.primary_reselect = newval->value; in bond_option_primary_reselect_set()
1530 bond_select_active_slave(bond); in bond_option_primary_reselect_set()
1536 static int bond_option_fail_over_mac_set(struct bonding *bond, in bond_option_fail_over_mac_set() argument
1539 netdev_dbg(bond->dev, "Setting fail_over_mac to %s (%llu)\n", in bond_option_fail_over_mac_set()
1541 bond->params.fail_over_mac = newval->value; in bond_option_fail_over_mac_set()
1546 static int bond_option_xmit_hash_policy_set(struct bonding *bond, in bond_option_xmit_hash_policy_set() argument
1549 netdev_dbg(bond->dev, "Setting xmit hash policy to %s (%llu)\n", in bond_option_xmit_hash_policy_set()
1551 bond->params.xmit_policy = newval->value; in bond_option_xmit_hash_policy_set()
1556 static int bond_option_resend_igmp_set(struct bonding *bond, in bond_option_resend_igmp_set() argument
1559 netdev_dbg(bond->dev, "Setting resend_igmp to %llu\n", in bond_option_resend_igmp_set()
1561 bond->params.resend_igmp = newval->value; in bond_option_resend_igmp_set()
1566 static int bond_option_num_peer_notif_set(struct bonding *bond, in bond_option_num_peer_notif_set() argument
1569 bond->params.num_peer_notif = newval->value; in bond_option_num_peer_notif_set()
1574 static int bond_option_all_slaves_active_set(struct bonding *bond, in bond_option_all_slaves_active_set() argument
1580 if (newval->value == bond->params.all_slaves_active) in bond_option_all_slaves_active_set()
1582 bond->params.all_slaves_active = newval->value; in bond_option_all_slaves_active_set()
1583 bond_for_each_slave(bond, slave, iter) { in bond_option_all_slaves_active_set()
1595 static int bond_option_min_links_set(struct bonding *bond, in bond_option_min_links_set() argument
1598 netdev_dbg(bond->dev, "Setting min links value to %llu\n", in bond_option_min_links_set()
1600 bond->params.min_links = newval->value; in bond_option_min_links_set()
1601 bond_set_carrier(bond); in bond_option_min_links_set()
1606 static int bond_option_lp_interval_set(struct bonding *bond, in bond_option_lp_interval_set() argument
1609 bond->params.lp_interval = newval->value; in bond_option_lp_interval_set()
1614 static int bond_option_pps_set(struct bonding *bond, in bond_option_pps_set() argument
1617 netdev_dbg(bond->dev, "Setting packets per slave to %llu\n", in bond_option_pps_set()
1619 bond->params.packets_per_slave = newval->value; in bond_option_pps_set()
1621 bond->params.reciprocal_packets_per_slave = in bond_option_pps_set()
1627 bond->params.reciprocal_packets_per_slave = in bond_option_pps_set()
1634 static int bond_option_lacp_active_set(struct bonding *bond, in bond_option_lacp_active_set() argument
1637 netdev_dbg(bond->dev, "Setting LACP active to %s (%llu)\n", in bond_option_lacp_active_set()
1639 bond->params.lacp_active = newval->value; in bond_option_lacp_active_set()
1644 static int bond_option_lacp_rate_set(struct bonding *bond, in bond_option_lacp_rate_set() argument
1647 netdev_dbg(bond->dev, "Setting LACP rate to %s (%llu)\n", in bond_option_lacp_rate_set()
1649 bond->params.lacp_fast = newval->value; in bond_option_lacp_rate_set()
1650 bond_3ad_update_lacp_rate(bond); in bond_option_lacp_rate_set()
1655 static int bond_option_ad_select_set(struct bonding *bond, in bond_option_ad_select_set() argument
1658 netdev_dbg(bond->dev, "Setting ad_select to %s (%llu)\n", in bond_option_ad_select_set()
1660 bond->params.ad_select = newval->value; in bond_option_ad_select_set()
1665 static int bond_option_queue_id_set(struct bonding *bond, in bond_option_queue_id_set() argument
1689 qid > bond->dev->real_num_tx_queues) in bond_option_queue_id_set()
1693 sdev = __dev_get_by_name(dev_net(bond->dev), newval->string); in bond_option_queue_id_set()
1699 bond_for_each_slave(bond, slave, iter) { in bond_option_queue_id_set()
1720 netdev_dbg(bond->dev, "invalid input for queue_id set\n"); in bond_option_queue_id_set()
1726 static int bond_option_slaves_set(struct bonding *bond, in bond_option_slaves_set() argument
1741 dev = __dev_get_by_name(dev_net(bond->dev), ifname); in bond_option_slaves_set()
1743 netdev_dbg(bond->dev, "interface %s does not exist!\n", in bond_option_slaves_set()
1751 slave_dbg(bond->dev, dev, "Enslaving interface\n"); in bond_option_slaves_set()
1752 ret = bond_enslave(bond->dev, dev, NULL); in bond_option_slaves_set()
1756 slave_dbg(bond->dev, dev, "Releasing interface\n"); in bond_option_slaves_set()
1757 ret = bond_release(bond->dev, dev); in bond_option_slaves_set()
1769 netdev_err(bond->dev, "no command found in slaves file - use +ifname or -ifname\n"); in bond_option_slaves_set()
1774 static int bond_option_tlb_dynamic_lb_set(struct bonding *bond, in bond_option_tlb_dynamic_lb_set() argument
1777 netdev_dbg(bond->dev, "Setting dynamic-lb to %s (%llu)\n", in bond_option_tlb_dynamic_lb_set()
1779 bond->params.tlb_dynamic_lb = newval->value; in bond_option_tlb_dynamic_lb_set()
1784 static int bond_option_ad_actor_sys_prio_set(struct bonding *bond, in bond_option_ad_actor_sys_prio_set() argument
1787 netdev_dbg(bond->dev, "Setting ad_actor_sys_prio to %llu\n", in bond_option_ad_actor_sys_prio_set()
1790 bond->params.ad_actor_sys_prio = newval->value; in bond_option_ad_actor_sys_prio_set()
1791 bond_3ad_update_ad_actor_settings(bond); in bond_option_ad_actor_sys_prio_set()
1796 static int bond_option_ad_actor_system_set(struct bonding *bond, in bond_option_ad_actor_system_set() argument
1813 netdev_dbg(bond->dev, "Setting ad_actor_system to %pM\n", mac); in bond_option_ad_actor_system_set()
1814 ether_addr_copy(bond->params.ad_actor_system, mac); in bond_option_ad_actor_system_set()
1815 bond_3ad_update_ad_actor_settings(bond); in bond_option_ad_actor_system_set()
1820 netdev_err(bond->dev, "Invalid ad_actor_system MAC address.\n"); in bond_option_ad_actor_system_set()
1824 static int bond_option_ad_user_port_key_set(struct bonding *bond, in bond_option_ad_user_port_key_set() argument
1827 netdev_dbg(bond->dev, "Setting ad_user_port_key to %llu\n", in bond_option_ad_user_port_key_set()
1830 bond->params.ad_user_port_key = newval->value; in bond_option_ad_user_port_key_set()
1834 static int bond_option_coupled_control_set(struct bonding *bond, in bond_option_coupled_control_set() argument
1837 netdev_info(bond->dev, "Setting coupled_control to %s (%llu)\n", in bond_option_coupled_control_set()
1840 bond->params.coupled_control = newval->value; in bond_option_coupled_control_set()