Lines Matching defs:team

3  * drivers/net/team/team.c - Network team device driver
30 #define DRV_NAME "team"
63 static int team_port_set_team_dev_addr(struct team *team,
66 return __set_port_dev_addr(port->dev, team->dev->dev_addr);
69 int team_modeop_port_enter(struct team *team, struct team_port *port)
71 return team_port_set_team_dev_addr(team, port);
75 void team_modeop_port_change_dev_addr(struct team *team,
78 team_port_set_team_dev_addr(team, port);
116 static struct team_option *__team_find_option(struct team *team,
121 list_for_each_entry(option, &team->option_list, list) {
134 static void __team_option_inst_del_option(struct team *team,
139 list_for_each_entry_safe(opt_inst, tmp, &team->option_inst_list, list) {
145 static int __team_option_inst_add(struct team *team, struct team_option *option,
166 list_add_tail(&opt_inst->list, &team->option_inst_list);
168 err = option->init(team, &opt_inst->info);
177 static int __team_option_inst_add_option(struct team *team,
183 err = __team_option_inst_add(team, option, NULL);
190 __team_option_inst_del_option(team, option);
194 static void __team_option_inst_mark_removed_option(struct team *team,
199 list_for_each_entry(opt_inst, &team->option_inst_list, list) {
207 static void __team_option_inst_del_port(struct team *team,
212 list_for_each_entry_safe(opt_inst, tmp, &team->option_inst_list, list) {
219 static int __team_option_inst_add_port(struct team *team,
225 list_for_each_entry(option, &team->option_list, list) {
228 err = __team_option_inst_add(team, option, port);
235 __team_option_inst_del_port(team, port);
239 static void __team_option_inst_mark_removed_port(struct team *team,
244 list_for_each_entry(opt_inst, &team->option_inst_list, list) {
252 static int __team_options_register(struct team *team,
265 if (__team_find_option(team, option->name)) {
277 err = __team_option_inst_add_option(team, dst_opts[i]);
280 list_add_tail(&dst_opts[i]->list, &team->option_list);
288 __team_option_inst_del_option(team, dst_opts[i]);
301 static void __team_options_mark_removed(struct team *team,
310 del_opt = __team_find_option(team, option->name);
312 __team_option_inst_mark_removed_option(team, del_opt);
316 static void __team_options_unregister(struct team *team,
325 del_opt = __team_find_option(team, option->name);
327 __team_option_inst_del_option(team, del_opt);
334 static void __team_options_change_check(struct team *team);
336 int team_options_register(struct team *team,
342 err = __team_options_register(team, option, option_count);
345 __team_options_change_check(team);
350 void team_options_unregister(struct team *team,
354 __team_options_mark_removed(team, option, option_count);
355 __team_options_change_check(team);
356 __team_options_unregister(team, option, option_count);
360 static int team_option_get(struct team *team,
366 return opt_inst->option->getter(team, ctx);
369 static int team_option_set(struct team *team,
375 return opt_inst->option->setter(team, ctx);
387 void team_options_change_check(struct team *team)
389 __team_options_change_check(team);
480 request_module("team-mode-%s", kind);
500 static bool team_dummy_transmit(struct team *team, struct sk_buff *skb)
506 static rx_handler_result_t team_dummy_receive(struct team *team,
517 static bool team_is_mode_set(struct team *team)
519 return team->mode != &__team_no_mode;
522 static void team_set_no_mode(struct team *team)
524 team->user_carrier_enabled = false;
525 team->mode = &__team_no_mode;
528 static void team_adjust_ops(struct team *team)
535 if (!team->en_port_count || !team_is_mode_set(team) ||
536 !team->mode->ops->transmit)
537 team->ops.transmit = team_dummy_transmit;
539 team->ops.transmit = team->mode->ops->transmit;
541 if (!team->en_port_count || !team_is_mode_set(team) ||
542 !team->mode->ops->receive)
543 team->ops.receive = team_dummy_receive;
545 team->ops.receive = team->mode->ops->receive;
553 static int __team_change_mode(struct team *team,
557 if (team_is_mode_set(team)) {
558 void (*exit_op)(struct team *team) = team->ops.exit;
561 memset(&team->ops, 0, sizeof(struct team_mode_ops));
562 team_adjust_ops(team);
565 exit_op(team);
566 team_mode_put(team->mode);
567 team_set_no_mode(team);
569 memset(&team->mode_priv, 0,
570 sizeof(struct team) - offsetof(struct team, mode_priv));
579 err = new_mode->ops->init(team);
584 team->mode = new_mode;
585 memcpy(&team->ops, new_mode->ops, sizeof(struct team_mode_ops));
586 team_adjust_ops(team);
591 static int team_change_mode(struct team *team, const char *kind)
594 struct net_device *dev = team->dev;
597 if (!list_empty(&team->port_list)) {
602 if (team_is_mode_set(team) && strcmp(team->mode->kind, kind) == 0) {
603 netdev_err(dev, "Unable to change to the same mode the team is in\n");
613 err = __team_change_mode(team, new_mode);
631 struct team *team;
634 team = container_of(work, struct team, notify_peers.dw.work);
637 schedule_delayed_work(&team->notify_peers.dw, 0);
640 val = atomic_dec_if_positive(&team->notify_peers.count_pending);
645 call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, team->dev);
648 schedule_delayed_work(&team->notify_peers.dw,
649 msecs_to_jiffies(team->notify_peers.interval));
652 static void team_notify_peers(struct team *team)
654 if (!team->notify_peers.count || !netif_running(team->dev))
656 atomic_add(team->notify_peers.count, &team->notify_peers.count_pending);
657 schedule_delayed_work(&team->notify_peers.dw, 0);
660 static void team_notify_peers_init(struct team *team)
662 INIT_DELAYED_WORK(&team->notify_peers.dw, team_notify_peers_work);
665 static void team_notify_peers_fini(struct team *team)
667 cancel_delayed_work_sync(&team->notify_peers.dw);
677 struct team *team;
680 team = container_of(work, struct team, mcast_rejoin.dw.work);
683 schedule_delayed_work(&team->mcast_rejoin.dw, 0);
686 val = atomic_dec_if_positive(&team->mcast_rejoin.count_pending);
691 call_netdevice_notifiers(NETDEV_RESEND_IGMP, team->dev);
694 schedule_delayed_work(&team->mcast_rejoin.dw,
695 msecs_to_jiffies(team->mcast_rejoin.interval));
698 static void team_mcast_rejoin(struct team *team)
700 if (!team->mcast_rejoin.count || !netif_running(team->dev))
702 atomic_add(team->mcast_rejoin.count, &team->mcast_rejoin.count_pending);
703 schedule_delayed_work(&team->mcast_rejoin.dw, 0);
706 static void team_mcast_rejoin_init(struct team *team)
708 INIT_DELAYED_WORK(&team->mcast_rejoin.dw, team_mcast_rejoin_work);
711 static void team_mcast_rejoin_fini(struct team *team)
713 cancel_delayed_work_sync(&team->mcast_rejoin.dw);
726 struct team *team;
736 team = port->team;
741 res = team->ops.receive(team, port, skb);
746 pcpu_stats = this_cpu_ptr(team->pcpu_stats);
754 skb->dev = team->dev;
756 this_cpu_inc(team->pcpu_stats->rx_nohandler);
758 this_cpu_inc(team->pcpu_stats->rx_dropped);
769 static int team_queue_override_init(struct team *team)
772 unsigned int queue_cnt = team->dev->num_tx_queues - 1;
781 team->qom_lists = listarr;
787 static void team_queue_override_fini(struct team *team)
789 kfree(team->qom_lists);
792 static struct list_head *__team_get_qom_list(struct team *team, u16 queue_id)
794 return &team->qom_lists[queue_id - 1];
800 static bool team_queue_override_transmit(struct team *team, struct sk_buff *skb)
805 if (!team->queue_override_enabled || !skb->queue_mapping)
807 qom_list = __team_get_qom_list(team, skb->queue_mapping);
809 if (!team_dev_queue_xmit(team, port, skb))
815 static void __team_queue_override_port_del(struct team *team,
835 static void __team_queue_override_port_add(struct team *team,
844 qom_list = __team_get_qom_list(team, port->queue_id);
854 static void __team_queue_override_enabled_check(struct team *team)
859 list_for_each_entry(port, &team->port_list, list) {
865 if (enabled == team->queue_override_enabled)
867 netdev_dbg(team->dev, "%s queue override\n",
869 team->queue_override_enabled = enabled;
872 static void team_queue_override_port_prio_changed(struct team *team,
877 __team_queue_override_port_del(team, port);
878 __team_queue_override_port_add(team, port);
879 __team_queue_override_enabled_check(team);
882 static void team_queue_override_port_change_queue_id(struct team *team,
887 __team_queue_override_port_del(team, port);
889 __team_queue_override_port_add(team, port);
890 __team_queue_override_enabled_check(team);
896 static void team_queue_override_port_add(struct team *team,
899 __team_queue_override_port_add(team, port);
900 __team_queue_override_enabled_check(team);
903 static void team_queue_override_port_del(struct team *team,
906 __team_queue_override_port_del(team, port);
907 __team_queue_override_enabled_check(team);
915 static bool team_port_find(const struct team *team,
920 list_for_each_entry(cur, &team->port_list, list)
930 * by team->lock.
932 static void team_port_enable(struct team *team,
937 port->index = team->en_port_count++;
939 team_port_index_hash(team, port->index));
940 team_adjust_ops(team);
941 team_queue_override_port_add(team, port);
942 if (team->ops.port_enabled)
943 team->ops.port_enabled(team, port);
944 team_notify_peers(team);
945 team_mcast_rejoin(team);
949 static void __reconstruct_port_hlist(struct team *team, int rm_index)
954 for (i = rm_index + 1; i < team->en_port_count; i++) {
955 port = team_get_port_by_index(team, i);
959 team_port_index_hash(team, port->index));
963 static void team_port_disable(struct team *team,
968 if (team->ops.port_disabled)
969 team->ops.port_disabled(team, port);
971 __reconstruct_port_hlist(team, port->index);
973 team->en_port_count--;
974 team_queue_override_port_del(team, port);
975 team_adjust_ops(team);
986 static void __team_compute_features(struct team *team)
997 list_for_each_entry_rcu(port, &team->port_list, list) {
1013 team->dev->vlan_features = vlan_features;
1014 team->dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL |
1018 team->dev->hard_header_len = max_hard_header_len;
1020 team->dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
1022 team->dev->priv_flags |= IFF_XMIT_DST_RELEASE;
1025 static void team_compute_features(struct team *team)
1027 __team_compute_features(team);
1028 netdev_change_features(team->dev);
1031 static int team_port_enter(struct team *team, struct team_port *port)
1035 dev_hold(team->dev);
1036 if (team->ops.port_enter) {
1037 err = team->ops.port_enter(team, port);
1039 netdev_err(team->dev, "Device %s failed to enter team mode\n",
1048 dev_put(team->dev);
1053 static void team_port_leave(struct team *team, struct team_port *port)
1055 if (team->ops.port_leave)
1056 team->ops.port_leave(team, port);
1057 dev_put(team->dev);
1081 if (!port->team->dev->npinfo)
1107 static int team_upper_dev_link(struct team *team, struct team_port *port,
1113 lag_upper_info.tx_type = team->mode->lag_tx_type;
1115 err = netdev_master_upper_dev_link(port->dev, team->dev, NULL,
1123 static void team_upper_dev_unlink(struct team *team, struct team_port *port)
1125 netdev_upper_dev_unlink(port->dev, team->dev);
1133 static int team_port_add(struct team *team, struct net_device *port_dev,
1136 struct net_device *dev = team->dev;
1142 NL_SET_ERR_MSG(extack, "Loopback device can't be added as a team port");
1143 netdev_err(dev, "Device %s is loopback device. Loopback devices can't be added as a team port\n",
1149 NL_SET_ERR_MSG(extack, "Device is already a port of a team device");
1151 "of a team device\n", portname);
1156 NL_SET_ERR_MSG(extack, "Cannot enslave team device to itself");
1157 netdev_err(dev, "Cannot enslave team device to itself\n");
1162 NL_SET_ERR_MSG(extack, "Device is already an upper device of the team interface");
1163 netdev_err(dev, "Device %s is already an upper device of the team interface\n",
1170 NL_SET_ERR_MSG(extack, "Device is VLAN challenged and team device has VLAN set up");
1171 netdev_err(dev, "Device %s is VLAN challenged and team device has VLAN set up\n",
1181 NL_SET_ERR_MSG(extack, "Device is up. Set it down before adding it as a team port");
1182 netdev_err(dev, "Device %s is up. Set it down before adding it as a team port\n",
1187 port = kzalloc(sizeof(struct team_port) + team->mode->port_priv_size,
1193 port->team = team;
1205 err = team_port_enter(team, port);
1207 netdev_err(dev, "Device %s failed to enter team mode\n",
1244 err = team_upper_dev_link(team, port, extack);
1251 err = __team_option_inst_add_port(team, port);
1283 list_add_tail_rcu(&port->list, &team->port_list);
1284 team_port_enable(team, port);
1285 __team_compute_features(team);
1287 __team_options_change_check(team);
1294 __team_option_inst_del_port(team, port);
1297 team_upper_dev_unlink(team, port);
1312 team_port_leave(team, port);
1326 static int team_port_del(struct team *team, struct net_device *port_dev)
1328 struct net_device *dev = team->dev;
1333 if (!port || !team_port_find(team, port)) {
1334 netdev_err(dev, "Device %s does not act as a port of this team\n",
1339 team_port_disable(team, port);
1347 team_upper_dev_unlink(team, port);
1356 team_port_leave(team, port);
1358 __team_option_inst_mark_removed_port(team, port);
1359 __team_options_change_check(team);
1360 __team_option_inst_del_port(team, port);
1367 __team_compute_features(team);
1377 static int team_mode_option_get(struct team *team, struct team_gsetter_ctx *ctx)
1379 ctx->data.str_val = team->mode->kind;
1383 static int team_mode_option_set(struct team *team, struct team_gsetter_ctx *ctx)
1385 return team_change_mode(team, ctx->data.str_val);
1388 static int team_notify_peers_count_get(struct team *team,
1391 ctx->data.u32_val = team->notify_peers.count;
1395 static int team_notify_peers_count_set(struct team *team,
1398 team->notify_peers.count = ctx->data.u32_val;
1402 static int team_notify_peers_interval_get(struct team *team,
1405 ctx->data.u32_val = team->notify_peers.interval;
1409 static int team_notify_peers_interval_set(struct team *team,
1412 team->notify_peers.interval = ctx->data.u32_val;
1416 static int team_mcast_rejoin_count_get(struct team *team,
1419 ctx->data.u32_val = team->mcast_rejoin.count;
1423 static int team_mcast_rejoin_count_set(struct team *team,
1426 team->mcast_rejoin.count = ctx->data.u32_val;
1430 static int team_mcast_rejoin_interval_get(struct team *team,
1433 ctx->data.u32_val = team->mcast_rejoin.interval;
1437 static int team_mcast_rejoin_interval_set(struct team *team,
1440 team->mcast_rejoin.interval = ctx->data.u32_val;
1444 static int team_port_en_option_get(struct team *team,
1453 static int team_port_en_option_set(struct team *team,
1459 team_port_enable(team, port);
1461 team_port_disable(team, port);
1465 static int team_user_linkup_option_get(struct team *team,
1474 static void __team_carrier_check(struct team *team);
1476 static int team_user_linkup_option_set(struct team *team,
1483 __team_carrier_check(port->team);
1487 static int team_user_linkup_en_option_get(struct team *team,
1496 static int team_user_linkup_en_option_set(struct team *team,
1503 __team_carrier_check(port->team);
1507 static int team_priority_option_get(struct team *team,
1516 static int team_priority_option_set(struct team *team,
1525 team_queue_override_port_prio_changed(team, port);
1529 static int team_queue_id_option_get(struct team *team,
1538 static int team_queue_id_option_set(struct team *team,
1546 if (new_queue_id >= team->dev->real_num_tx_queues)
1548 team_queue_override_port_change_queue_id(team, port, new_queue_id);
1623 struct team *team = netdev_priv(dev);
1627 team->dev = dev;
1628 team_set_no_mode(team);
1629 team->notifier_ctx = false;
1631 team->pcpu_stats = netdev_alloc_pcpu_stats(struct team_pcpu_stats);
1632 if (!team->pcpu_stats)
1636 INIT_HLIST_HEAD(&team->en_port_hlist[i]);
1637 INIT_LIST_HEAD(&team->port_list);
1638 err = team_queue_override_init(team);
1642 team_adjust_ops(team);
1644 INIT_LIST_HEAD(&team->option_list);
1645 INIT_LIST_HEAD(&team->option_inst_list);
1647 team_notify_peers_init(team);
1648 team_mcast_rejoin_init(team);
1650 err = team_options_register(team, team_options, ARRAY_SIZE(team_options));
1655 lockdep_register_key(&team->team_lock_key);
1656 __mutex_init(&team->lock, "team->team_lock_key", &team->team_lock_key);
1662 team_mcast_rejoin_fini(team);
1663 team_notify_peers_fini(team);
1664 team_queue_override_fini(team);
1666 free_percpu(team->pcpu_stats);
1673 struct team *team = netdev_priv(dev);
1677 mutex_lock(&team->lock);
1678 list_for_each_entry_safe(port, tmp, &team->port_list, list)
1679 team_port_del(team, port->dev);
1681 __team_change_mode(team, NULL); /* cleanup */
1682 __team_options_unregister(team, team_options, ARRAY_SIZE(team_options));
1683 team_mcast_rejoin_fini(team);
1684 team_notify_peers_fini(team);
1685 team_queue_override_fini(team);
1686 mutex_unlock(&team->lock);
1688 lockdep_unregister_key(&team->team_lock_key);
1693 struct team *team = netdev_priv(dev);
1695 free_percpu(team->pcpu_stats);
1705 struct team *team = netdev_priv(dev);
1708 list_for_each_entry(port, &team->port_list, list) {
1721 struct team *team = netdev_priv(dev);
1725 tx_success = team_queue_override_transmit(team, skb);
1727 tx_success = team->ops.transmit(team, skb);
1731 pcpu_stats = this_cpu_ptr(team->pcpu_stats);
1737 this_cpu_inc(team->pcpu_stats->tx_dropped);
1750 * way down to the team driver.
1769 struct team *team = netdev_priv(dev);
1774 list_for_each_entry_rcu(port, &team->port_list, list) {
1789 struct team *team = netdev_priv(dev);
1793 list_for_each_entry_rcu(port, &team->port_list, list) {
1803 struct team *team = netdev_priv(dev);
1809 mutex_lock(&team->lock);
1810 list_for_each_entry(port, &team->port_list, list)
1811 if (team->ops.port_change_dev_addr)
1812 team->ops.port_change_dev_addr(team, port);
1813 mutex_unlock(&team->lock);
1819 struct team *team = netdev_priv(dev);
1824 * Alhough this is reader, it's guarded by team lock. It's not possible
1827 mutex_lock(&team->lock);
1828 team->port_mtu_change_allowed = true;
1829 list_for_each_entry(port, &team->port_list, list) {
1837 team->port_mtu_change_allowed = false;
1838 mutex_unlock(&team->lock);
1845 list_for_each_entry_continue_reverse(port, &team->port_list, list)
1847 team->port_mtu_change_allowed = false;
1848 mutex_unlock(&team->lock);
1856 struct team *team = netdev_priv(dev);
1864 p = per_cpu_ptr(team->pcpu_stats, i);
1894 struct team *team = netdev_priv(dev);
1899 * Alhough this is reader, it's guarded by team lock. It's not possible
1902 mutex_lock(&team->lock);
1903 list_for_each_entry(port, &team->port_list, list) {
1908 mutex_unlock(&team->lock);
1913 list_for_each_entry_continue_reverse(port, &team->port_list, list)
1915 mutex_unlock(&team->lock);
1922 struct team *team = netdev_priv(dev);
1925 mutex_lock(&team->lock);
1926 list_for_each_entry(port, &team->port_list, list)
1928 mutex_unlock(&team->lock);
1938 static void __team_netpoll_cleanup(struct team *team)
1942 list_for_each_entry(port, &team->port_list, list)
1948 struct team *team = netdev_priv(dev);
1950 mutex_lock(&team->lock);
1951 __team_netpoll_cleanup(team);
1952 mutex_unlock(&team->lock);
1958 struct team *team = netdev_priv(dev);
1962 mutex_lock(&team->lock);
1963 list_for_each_entry(port, &team->port_list, list) {
1966 __team_netpoll_cleanup(team);
1970 mutex_unlock(&team->lock);
1978 struct team *team = netdev_priv(dev);
1981 mutex_lock(&team->lock);
1982 err = team_port_add(team, port_dev, extack);
1983 mutex_unlock(&team->lock);
1993 struct team *team = netdev_priv(dev);
1996 mutex_lock(&team->lock);
1997 err = team_port_del(team, port_dev);
1998 mutex_unlock(&team->lock);
2004 lockdep_unregister_key(&team->team_lock_key);
2005 lockdep_register_key(&team->team_lock_key);
2006 lockdep_set_class(&team->lock, &team->team_lock_key);
2017 struct team *team = netdev_priv(dev);
2025 list_for_each_entry_rcu(port, &team->port_list, list) {
2039 struct team *team = netdev_priv(dev);
2041 team->user_carrier_enabled = true;
2090 struct team *team= netdev_priv(dev);
2098 list_for_each_entry_rcu(port, &team->port_list, list) {
2127 struct team *team = netdev_priv(dev);
2130 dev->header_ops = team->header_ops_cache;
2154 struct team *team = netdev_priv(dev);
2160 if (!list_empty(&team->port_list)) {
2179 struct team *team = netdev_priv(dev);
2183 team->header_ops_cache = dev->header_ops;
2203 /* Don't allow team devices to change network namespaces. */
2251 .priv_size = sizeof(struct team),
2318 static struct team *team_nl_team_get(struct genl_info *info)
2323 struct team *team;
2336 team = netdev_priv(dev);
2337 mutex_lock(&team->lock);
2338 return team;
2341 static void team_nl_team_put(struct team *team)
2343 mutex_unlock(&team->lock);
2344 dev_put(team->dev);
2348 struct team *team, u32 portid);
2350 static int team_nl_send_unicast(struct sk_buff *skb, struct team *team, u32 portid)
2352 return genlmsg_unicast(dev_net(team->dev), skb, portid);
2355 static int team_nl_fill_one_option_get(struct sk_buff *skb, struct team *team,
2365 err = team_option_get(team, opt_inst, &ctx);
2437 struct team *team, u32 portid,
2443 err = send_func(*pskb, team, portid);
2453 static int team_nl_send_options_get(struct team *team, u32 portid, u32 seq,
2470 err = __send_and_alloc_skb(&skb, team, portid, send_func);
2481 if (nla_put_u32(skb, TEAM_ATTR_TEAM_IFINDEX, team->dev->ifindex))
2490 err = team_nl_fill_one_option_get(skb, team, opt_inst);
2511 err = __send_and_alloc_skb(&skb, team, portid, send_func);
2517 return send_func(skb, team, portid);
2528 struct team *team;
2533 team = team_nl_team_get(info);
2534 if (!team)
2537 list_for_each_entry(opt_inst, &team->option_inst_list, list)
2539 err = team_nl_send_options_get(team, info->snd_portid, info->snd_seq,
2543 team_nl_team_put(team);
2548 static int team_nl_send_event_options_get(struct team *team,
2553 struct team *team;
2560 team = team_nl_team_get(info);
2561 if (!team) {
2638 list_for_each_entry(opt_inst, &team->option_inst_list, list) {
2679 err = team_option_set(team, opt_inst, &ctx);
2690 err = team_nl_send_event_options_get(team, &opt_inst_list);
2696 team_nl_team_put(team);
2732 static int team_nl_send_port_list_get(struct team *team, u32 portid, u32 seq,
2745 port = list_first_entry_or_null(&team->port_list,
2749 err = __send_and_alloc_skb(&skb, team, portid, send_func);
2760 if (nla_put_u32(skb, TEAM_ATTR_TEAM_IFINDEX, team->dev->ifindex))
2777 list_for_each_entry_from(port, &team->port_list, list) {
2800 err = __send_and_alloc_skb(&skb, team, portid, send_func);
2806 return send_func(skb, team, portid);
2818 struct team *team;
2821 team = team_nl_team_get(info);
2822 if (!team)
2825 err = team_nl_send_port_list_get(team, info->snd_portid, info->snd_seq,
2828 team_nl_team_put(team);
2877 struct team *team, u32 portid)
2879 return genlmsg_multicast_netns(&team_nl_family, dev_net(team->dev),
2883 static int team_nl_send_event_options_get(struct team *team,
2886 return team_nl_send_options_get(team, 0, 0, 0, team_nl_send_multicast,
2890 static int team_nl_send_event_port_get(struct team *team,
2893 return team_nl_send_port_list_get(team, 0, 0, 0, team_nl_send_multicast,
2912 static void __team_options_change_check(struct team *team)
2918 list_for_each_entry(opt_inst, &team->option_inst_list, list) {
2922 err = team_nl_send_event_options_get(team, &sel_opt_inst_list);
2924 netdev_warn(team->dev, "Failed to send options change via netlink (err %d)\n",
2951 err = team_nl_send_event_port_get(port->team, port);
2953 netdev_warn(port->team->dev, "Failed to send port change of device %s via netlink (err %d)\n",
2958 static void __team_carrier_check(struct team *team)
2963 if (team->user_carrier_enabled)
2967 list_for_each_entry(port, &team->port_list, list) {
2975 netif_carrier_on(team->dev);
2977 netif_carrier_off(team->dev);
2984 __team_carrier_check(port->team);
2990 __team_carrier_check(port->team);
2997 __team_carrier_check(port->team);
3002 struct team *team = port->team;
3004 mutex_lock(&team->lock);
3006 mutex_unlock(&team->lock);
3038 team_del_slave(port->team->dev, dev);
3041 if (!port->team->notifier_ctx) {
3042 port->team->notifier_ctx = true;
3043 team_compute_features(port->team);
3044 port->team->notifier_ctx = false;
3049 if (!port->team->port_mtu_change_allowed)
3057 call_netdevice_notifiers(event, port->team->dev);
3109 MODULE_DESCRIPTION("Ethernet team device driver");