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,
165 list_add_tail(&opt_inst->list, &team->option_inst_list);
167 option->init(team, &opt_inst->info);
173 static int __team_option_inst_add_option(struct team *team,
179 err = __team_option_inst_add(team, option, NULL);
186 __team_option_inst_del_option(team, option);
190 static void __team_option_inst_mark_removed_option(struct team *team,
195 list_for_each_entry(opt_inst, &team->option_inst_list, list) {
203 static void __team_option_inst_del_port(struct team *team,
208 list_for_each_entry_safe(opt_inst, tmp, &team->option_inst_list, list) {
215 static int __team_option_inst_add_port(struct team *team,
221 list_for_each_entry(option, &team->option_list, list) {
224 err = __team_option_inst_add(team, option, port);
231 __team_option_inst_del_port(team, port);
235 static void __team_option_inst_mark_removed_port(struct team *team,
240 list_for_each_entry(opt_inst, &team->option_inst_list, list) {
248 static int __team_options_register(struct team *team,
261 if (__team_find_option(team, option->name)) {
273 err = __team_option_inst_add_option(team, dst_opts[i]);
276 list_add_tail(&dst_opts[i]->list, &team->option_list);
284 __team_option_inst_del_option(team, dst_opts[i]);
297 static void __team_options_mark_removed(struct team *team,
306 del_opt = __team_find_option(team, option->name);
308 __team_option_inst_mark_removed_option(team, del_opt);
312 static void __team_options_unregister(struct team *team,
321 del_opt = __team_find_option(team, option->name);
323 __team_option_inst_del_option(team, del_opt);
330 static void __team_options_change_check(struct team *team);
332 int team_options_register(struct team *team,
338 err = __team_options_register(team, option, option_count);
341 __team_options_change_check(team);
346 void team_options_unregister(struct team *team,
350 __team_options_mark_removed(team, option, option_count);
351 __team_options_change_check(team);
352 __team_options_unregister(team, option, option_count);
356 static int team_option_get(struct team *team,
363 opt_inst->option->getter(team, ctx);
367 static int team_option_set(struct team *team,
373 return opt_inst->option->setter(team, ctx);
385 void team_options_change_check(struct team *team)
387 __team_options_change_check(team);
478 request_module("team-mode-%s", kind);
498 static bool team_dummy_transmit(struct team *team, struct sk_buff *skb)
504 static rx_handler_result_t team_dummy_receive(struct team *team,
515 static bool team_is_mode_set(struct team *team)
517 return team->mode != &__team_no_mode;
520 static void team_set_no_mode(struct team *team)
522 team->user_carrier_enabled = false;
523 team->mode = &__team_no_mode;
526 static void team_adjust_ops(struct team *team)
533 if (!team->en_port_count || !team_is_mode_set(team) ||
534 !team->mode->ops->transmit)
535 team->ops.transmit = team_dummy_transmit;
537 team->ops.transmit = team->mode->ops->transmit;
539 if (!team->en_port_count || !team_is_mode_set(team) ||
540 !team->mode->ops->receive)
541 team->ops.receive = team_dummy_receive;
543 team->ops.receive = team->mode->ops->receive;
551 static int __team_change_mode(struct team *team,
555 if (team_is_mode_set(team)) {
556 void (*exit_op)(struct team *team) = team->ops.exit;
559 memset(&team->ops, 0, sizeof(struct team_mode_ops));
560 team_adjust_ops(team);
563 exit_op(team);
564 team_mode_put(team->mode);
565 team_set_no_mode(team);
567 memset(&team->mode_priv, 0,
568 sizeof(struct team) - offsetof(struct team, mode_priv));
577 err = new_mode->ops->init(team);
582 team->mode = new_mode;
583 memcpy(&team->ops, new_mode->ops, sizeof(struct team_mode_ops));
584 team_adjust_ops(team);
589 static int team_change_mode(struct team *team, const char *kind)
592 struct net_device *dev = team->dev;
595 if (!list_empty(&team->port_list)) {
600 if (team_is_mode_set(team) && strcmp(team->mode->kind, kind) == 0) {
601 netdev_err(dev, "Unable to change to the same mode the team is in\n");
611 err = __team_change_mode(team, new_mode);
629 struct team *team;
632 team = container_of(work, struct team, notify_peers.dw.work);
635 schedule_delayed_work(&team->notify_peers.dw, 0);
638 val = atomic_dec_if_positive(&team->notify_peers.count_pending);
643 call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, team->dev);
646 schedule_delayed_work(&team->notify_peers.dw,
647 msecs_to_jiffies(team->notify_peers.interval));
650 static void team_notify_peers(struct team *team)
652 if (!team->notify_peers.count || !netif_running(team->dev))
654 atomic_add(team->notify_peers.count, &team->notify_peers.count_pending);
655 schedule_delayed_work(&team->notify_peers.dw, 0);
658 static void team_notify_peers_init(struct team *team)
660 INIT_DELAYED_WORK(&team->notify_peers.dw, team_notify_peers_work);
663 static void team_notify_peers_fini(struct team *team)
665 cancel_delayed_work_sync(&team->notify_peers.dw);
675 struct team *team;
678 team = container_of(work, struct team, mcast_rejoin.dw.work);
681 schedule_delayed_work(&team->mcast_rejoin.dw, 0);
684 val = atomic_dec_if_positive(&team->mcast_rejoin.count_pending);
689 call_netdevice_notifiers(NETDEV_RESEND_IGMP, team->dev);
692 schedule_delayed_work(&team->mcast_rejoin.dw,
693 msecs_to_jiffies(team->mcast_rejoin.interval));
696 static void team_mcast_rejoin(struct team *team)
698 if (!team->mcast_rejoin.count || !netif_running(team->dev))
700 atomic_add(team->mcast_rejoin.count, &team->mcast_rejoin.count_pending);
701 schedule_delayed_work(&team->mcast_rejoin.dw, 0);
704 static void team_mcast_rejoin_init(struct team *team)
706 INIT_DELAYED_WORK(&team->mcast_rejoin.dw, team_mcast_rejoin_work);
709 static void team_mcast_rejoin_fini(struct team *team)
711 cancel_delayed_work_sync(&team->mcast_rejoin.dw);
724 struct team *team;
734 team = port->team;
744 res = team->ops.receive(team, port, skb);
749 pcpu_stats = this_cpu_ptr(team->pcpu_stats);
757 skb->dev = team->dev;
759 this_cpu_inc(team->pcpu_stats->rx_nohandler);
761 this_cpu_inc(team->pcpu_stats->rx_dropped);
772 static int team_queue_override_init(struct team *team)
775 unsigned int queue_cnt = team->dev->num_tx_queues - 1;
784 team->qom_lists = listarr;
790 static void team_queue_override_fini(struct team *team)
792 kfree(team->qom_lists);
795 static struct list_head *__team_get_qom_list(struct team *team, u16 queue_id)
797 return &team->qom_lists[queue_id - 1];
803 static bool team_queue_override_transmit(struct team *team, struct sk_buff *skb)
808 if (!team->queue_override_enabled || !skb->queue_mapping)
810 qom_list = __team_get_qom_list(team, skb->queue_mapping);
812 if (!team_dev_queue_xmit(team, port, skb))
818 static void __team_queue_override_port_del(struct team *team,
838 static void __team_queue_override_port_add(struct team *team,
847 qom_list = __team_get_qom_list(team, port->queue_id);
857 static void __team_queue_override_enabled_check(struct team *team)
862 list_for_each_entry(port, &team->port_list, list) {
868 if (enabled == team->queue_override_enabled)
870 netdev_dbg(team->dev, "%s queue override\n",
872 team->queue_override_enabled = enabled;
875 static void team_queue_override_port_prio_changed(struct team *team,
880 __team_queue_override_port_del(team, port);
881 __team_queue_override_port_add(team, port);
882 __team_queue_override_enabled_check(team);
885 static void team_queue_override_port_change_queue_id(struct team *team,
890 __team_queue_override_port_del(team, port);
892 __team_queue_override_port_add(team, port);
893 __team_queue_override_enabled_check(team);
899 static void team_queue_override_port_add(struct team *team,
902 __team_queue_override_port_add(team, port);
903 __team_queue_override_enabled_check(team);
906 static void team_queue_override_port_del(struct team *team,
909 __team_queue_override_port_del(team, port);
910 __team_queue_override_enabled_check(team);
918 static bool team_port_find(const struct team *team,
923 list_for_each_entry(cur, &team->port_list, list)
933 * by team->lock.
935 static void team_port_enable(struct team *team,
940 port->index = team->en_port_count++;
942 team_port_index_hash(team, port->index));
943 team_adjust_ops(team);
944 team_queue_override_port_add(team, port);
945 if (team->ops.port_enabled)
946 team->ops.port_enabled(team, port);
947 team_notify_peers(team);
948 team_mcast_rejoin(team);
952 static void __reconstruct_port_hlist(struct team *team, int rm_index)
957 for (i = rm_index + 1; i < team->en_port_count; i++) {
958 port = team_get_port_by_index(team, i);
962 team_port_index_hash(team, port->index));
966 static void team_port_disable(struct team *team,
971 if (team->ops.port_disabled)
972 team->ops.port_disabled(team, port);
974 __reconstruct_port_hlist(team, port->index);
976 team->en_port_count--;
977 team_queue_override_port_del(team, port);
978 team_adjust_ops(team);
989 static void __team_compute_features(struct team *team)
1000 list_for_each_entry_rcu(port, &team->port_list, list) {
1016 team->dev->vlan_features = vlan_features;
1017 team->dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL |
1020 team->dev->hard_header_len = max_hard_header_len;
1022 team->dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
1024 team->dev->priv_flags |= IFF_XMIT_DST_RELEASE;
1027 static void team_compute_features(struct team *team)
1029 __team_compute_features(team);
1030 netdev_change_features(team->dev);
1033 static int team_port_enter(struct team *team, struct team_port *port)
1037 dev_hold(team->dev);
1038 if (team->ops.port_enter) {
1039 err = team->ops.port_enter(team, port);
1041 netdev_err(team->dev, "Device %s failed to enter team mode\n",
1050 dev_put(team->dev);
1055 static void team_port_leave(struct team *team, struct team_port *port)
1057 if (team->ops.port_leave)
1058 team->ops.port_leave(team, port);
1059 dev_put(team->dev);
1083 if (!port->team->dev->npinfo)
1109 static int team_upper_dev_link(struct team *team, struct team_port *port,
1115 lag_upper_info.tx_type = team->mode->lag_tx_type;
1117 err = netdev_master_upper_dev_link(port->dev, team->dev, NULL,
1125 static void team_upper_dev_unlink(struct team *team, struct team_port *port)
1127 netdev_upper_dev_unlink(port->dev, team->dev);
1135 static int team_port_add(struct team *team, struct net_device *port_dev,
1138 struct net_device *dev = team->dev;
1144 NL_SET_ERR_MSG(extack, "Loopback device can't be added as a team port");
1145 netdev_err(dev, "Device %s is loopback device. Loopback devices can't be added as a team port\n",
1151 NL_SET_ERR_MSG(extack, "Device is already a port of a team device");
1153 "of a team device\n", portname);
1158 NL_SET_ERR_MSG(extack, "Cannot enslave team device to itself");
1159 netdev_err(dev, "Cannot enslave team device to itself\n");
1164 NL_SET_ERR_MSG(extack, "Device is already an upper device of the team interface");
1165 netdev_err(dev, "Device %s is already an upper device of the team interface\n",
1172 NL_SET_ERR_MSG(extack, "Device is VLAN challenged and team device has VLAN set up");
1173 netdev_err(dev, "Device %s is VLAN challenged and team device has VLAN set up\n",
1183 NL_SET_ERR_MSG(extack, "Device is up. Set it down before adding it as a team port");
1184 netdev_err(dev, "Device %s is up. Set it down before adding it as a team port\n",
1189 port = kzalloc(sizeof(struct team_port) + team->mode->port_priv_size,
1195 port->team = team;
1207 err = team_port_enter(team, port);
1209 netdev_err(dev, "Device %s failed to enter team mode\n",
1246 err = team_upper_dev_link(team, port, extack);
1253 err = __team_option_inst_add_port(team, port);
1285 list_add_tail_rcu(&port->list, &team->port_list);
1286 team_port_enable(team, port);
1287 __team_compute_features(team);
1289 __team_options_change_check(team);
1296 __team_option_inst_del_port(team, port);
1299 team_upper_dev_unlink(team, port);
1314 team_port_leave(team, port);
1328 static int team_port_del(struct team *team, struct net_device *port_dev)
1330 struct net_device *dev = team->dev;
1335 if (!port || !team_port_find(team, port)) {
1336 netdev_err(dev, "Device %s does not act as a port of this team\n",
1341 team_port_disable(team, port);
1349 team_upper_dev_unlink(team, port);
1358 team_port_leave(team, port);
1360 __team_option_inst_mark_removed_port(team, port);
1361 __team_options_change_check(team);
1362 __team_option_inst_del_port(team, port);
1369 __team_compute_features(team);
1379 static void team_mode_option_get(struct team *team, struct team_gsetter_ctx *ctx)
1381 ctx->data.str_val = team->mode->kind;
1384 static int team_mode_option_set(struct team *team, struct team_gsetter_ctx *ctx)
1386 return team_change_mode(team, ctx->data.str_val);
1389 static void team_notify_peers_count_get(struct team *team,
1392 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 void team_notify_peers_interval_get(struct team *team,
1405 ctx->data.u32_val = team->notify_peers.interval;
1408 static int team_notify_peers_interval_set(struct team *team,
1411 team->notify_peers.interval = ctx->data.u32_val;
1415 static void team_mcast_rejoin_count_get(struct team *team,
1418 ctx->data.u32_val = team->mcast_rejoin.count;
1421 static int team_mcast_rejoin_count_set(struct team *team,
1424 team->mcast_rejoin.count = ctx->data.u32_val;
1428 static void team_mcast_rejoin_interval_get(struct team *team,
1431 ctx->data.u32_val = team->mcast_rejoin.interval;
1434 static int team_mcast_rejoin_interval_set(struct team *team,
1437 team->mcast_rejoin.interval = ctx->data.u32_val;
1441 static void team_port_en_option_get(struct team *team,
1449 static int team_port_en_option_set(struct team *team,
1455 team_port_enable(team, port);
1457 team_port_disable(team, port);
1461 static void team_user_linkup_option_get(struct team *team,
1469 static void __team_carrier_check(struct team *team);
1471 static int team_user_linkup_option_set(struct team *team,
1478 __team_carrier_check(port->team);
1482 static void team_user_linkup_en_option_get(struct team *team,
1490 static int team_user_linkup_en_option_set(struct team *team,
1497 __team_carrier_check(port->team);
1501 static void team_priority_option_get(struct team *team,
1509 static int team_priority_option_set(struct team *team,
1518 team_queue_override_port_prio_changed(team, port);
1522 static void team_queue_id_option_get(struct team *team,
1530 static int team_queue_id_option_set(struct team *team,
1538 if (new_queue_id >= team->dev->real_num_tx_queues)
1540 team_queue_override_port_change_queue_id(team, port, new_queue_id);
1615 struct team *team = netdev_priv(dev);
1619 team->dev = dev;
1620 team_set_no_mode(team);
1621 team->notifier_ctx = false;
1623 team->pcpu_stats = netdev_alloc_pcpu_stats(struct team_pcpu_stats);
1624 if (!team->pcpu_stats)
1628 INIT_HLIST_HEAD(&team->en_port_hlist[i]);
1629 INIT_LIST_HEAD(&team->port_list);
1630 err = team_queue_override_init(team);
1634 team_adjust_ops(team);
1636 INIT_LIST_HEAD(&team->option_list);
1637 INIT_LIST_HEAD(&team->option_inst_list);
1639 team_notify_peers_init(team);
1640 team_mcast_rejoin_init(team);
1642 err = team_options_register(team, team_options, ARRAY_SIZE(team_options));
1647 lockdep_register_key(&team->team_lock_key);
1648 __mutex_init(&team->lock, "team->team_lock_key", &team->team_lock_key);
1654 team_mcast_rejoin_fini(team);
1655 team_notify_peers_fini(team);
1656 team_queue_override_fini(team);
1658 free_percpu(team->pcpu_stats);
1665 struct team *team = netdev_priv(dev);
1669 mutex_lock(&team->lock);
1670 list_for_each_entry_safe(port, tmp, &team->port_list, list)
1671 team_port_del(team, port->dev);
1673 __team_change_mode(team, NULL); /* cleanup */
1674 __team_options_unregister(team, team_options, ARRAY_SIZE(team_options));
1675 team_mcast_rejoin_fini(team);
1676 team_notify_peers_fini(team);
1677 team_queue_override_fini(team);
1678 mutex_unlock(&team->lock);
1680 lockdep_unregister_key(&team->team_lock_key);
1685 struct team *team = netdev_priv(dev);
1687 free_percpu(team->pcpu_stats);
1697 struct team *team = netdev_priv(dev);
1700 list_for_each_entry(port, &team->port_list, list) {
1713 struct team *team = netdev_priv(dev);
1717 tx_success = team_queue_override_transmit(team, skb);
1719 tx_success = team->ops.transmit(team, skb);
1723 pcpu_stats = this_cpu_ptr(team->pcpu_stats);
1729 this_cpu_inc(team->pcpu_stats->tx_dropped);
1742 * way down to the team driver.
1761 struct team *team = netdev_priv(dev);
1766 list_for_each_entry_rcu(port, &team->port_list, list) {
1781 struct team *team = netdev_priv(dev);
1785 list_for_each_entry_rcu(port, &team->port_list, list) {
1795 struct team *team = netdev_priv(dev);
1801 mutex_lock(&team->lock);
1802 list_for_each_entry(port, &team->port_list, list)
1803 if (team->ops.port_change_dev_addr)
1804 team->ops.port_change_dev_addr(team, port);
1805 mutex_unlock(&team->lock);
1811 struct team *team = netdev_priv(dev);
1816 * Alhough this is reader, it's guarded by team lock. It's not possible
1819 mutex_lock(&team->lock);
1820 team->port_mtu_change_allowed = true;
1821 list_for_each_entry(port, &team->port_list, list) {
1829 team->port_mtu_change_allowed = false;
1830 mutex_unlock(&team->lock);
1837 list_for_each_entry_continue_reverse(port, &team->port_list, list)
1839 team->port_mtu_change_allowed = false;
1840 mutex_unlock(&team->lock);
1848 struct team *team = netdev_priv(dev);
1856 p = per_cpu_ptr(team->pcpu_stats, i);
1886 struct team *team = netdev_priv(dev);
1891 * Alhough this is reader, it's guarded by team lock. It's not possible
1894 mutex_lock(&team->lock);
1895 list_for_each_entry(port, &team->port_list, list) {
1900 mutex_unlock(&team->lock);
1905 list_for_each_entry_continue_reverse(port, &team->port_list, list)
1907 mutex_unlock(&team->lock);
1914 struct team *team = netdev_priv(dev);
1917 mutex_lock(&team->lock);
1918 list_for_each_entry(port, &team->port_list, list)
1920 mutex_unlock(&team->lock);
1930 static void __team_netpoll_cleanup(struct team *team)
1934 list_for_each_entry(port, &team->port_list, list)
1940 struct team *team = netdev_priv(dev);
1942 mutex_lock(&team->lock);
1943 __team_netpoll_cleanup(team);
1944 mutex_unlock(&team->lock);
1950 struct team *team = netdev_priv(dev);
1954 mutex_lock(&team->lock);
1955 list_for_each_entry(port, &team->port_list, list) {
1958 __team_netpoll_cleanup(team);
1962 mutex_unlock(&team->lock);
1970 struct team *team = netdev_priv(dev);
1973 mutex_lock(&team->lock);
1974 err = team_port_add(team, port_dev, extack);
1975 mutex_unlock(&team->lock);
1985 struct team *team = netdev_priv(dev);
1988 mutex_lock(&team->lock);
1989 err = team_port_del(team, port_dev);
1990 mutex_unlock(&team->lock);
1996 lockdep_unregister_key(&team->team_lock_key);
1997 lockdep_register_key(&team->team_lock_key);
1998 lockdep_set_class(&team->lock, &team->team_lock_key);
2009 struct team *team = netdev_priv(dev);
2017 list_for_each_entry_rcu(port, &team->port_list, list) {
2031 struct team *team = netdev_priv(dev);
2033 team->user_carrier_enabled = true;
2081 struct team *team= netdev_priv(dev);
2089 list_for_each_entry_rcu(port, &team->port_list, list) {
2118 struct team *team = netdev_priv(dev);
2121 dev->header_ops = team->header_ops_cache;
2145 struct team *team = netdev_priv(dev);
2151 if (!list_empty(&team->port_list)) {
2170 struct team *team = netdev_priv(dev);
2174 team->header_ops_cache = dev->header_ops;
2194 /* Don't allow team devices to change network namespaces. */
2242 .priv_size = sizeof(struct team),
2309 static struct team *team_nl_team_get(struct genl_info *info)
2314 struct team *team;
2326 team = netdev_priv(dev);
2327 mutex_lock(&team->lock);
2328 return team;
2331 static void team_nl_team_put(struct team *team)
2333 mutex_unlock(&team->lock);
2334 dev_put(team->dev);
2338 struct team *team, u32 portid);
2340 static int team_nl_send_unicast(struct sk_buff *skb, struct team *team, u32 portid)
2342 return genlmsg_unicast(dev_net(team->dev), skb, portid);
2345 static int team_nl_fill_one_option_get(struct sk_buff *skb, struct team *team,
2355 err = team_option_get(team, opt_inst, &ctx);
2427 struct team *team, u32 portid,
2433 err = send_func(*pskb, team, portid);
2443 static int team_nl_send_options_get(struct team *team, u32 portid, u32 seq,
2460 err = __send_and_alloc_skb(&skb, team, portid, send_func);
2471 if (nla_put_u32(skb, TEAM_ATTR_TEAM_IFINDEX, team->dev->ifindex))
2480 err = team_nl_fill_one_option_get(skb, team, opt_inst);
2501 err = __send_and_alloc_skb(&skb, team, portid, send_func);
2507 return send_func(skb, team, portid);
2518 struct team *team;
2523 team = team_nl_team_get(info);
2524 if (!team)
2527 list_for_each_entry(opt_inst, &team->option_inst_list, list)
2529 err = team_nl_send_options_get(team, info->snd_portid, info->snd_seq,
2533 team_nl_team_put(team);
2538 static int team_nl_send_event_options_get(struct team *team,
2543 struct team *team;
2550 team = team_nl_team_get(info);
2551 if (!team) {
2628 list_for_each_entry(opt_inst, &team->option_inst_list, list) {
2669 err = team_option_set(team, opt_inst, &ctx);
2680 err = team_nl_send_event_options_get(team, &opt_inst_list);
2686 team_nl_team_put(team);
2722 static int team_nl_send_port_list_get(struct team *team, u32 portid, u32 seq,
2735 port = list_first_entry_or_null(&team->port_list,
2739 err = __send_and_alloc_skb(&skb, team, portid, send_func);
2750 if (nla_put_u32(skb, TEAM_ATTR_TEAM_IFINDEX, team->dev->ifindex))
2767 list_for_each_entry_from(port, &team->port_list, list) {
2790 err = __send_and_alloc_skb(&skb, team, portid, send_func);
2796 return send_func(skb, team, portid);
2808 struct team *team;
2811 team = team_nl_team_get(info);
2812 if (!team)
2815 err = team_nl_send_port_list_get(team, info->snd_portid, info->snd_seq,
2818 team_nl_team_put(team);
2868 struct team *team, u32 portid)
2870 return genlmsg_multicast_netns(&team_nl_family, dev_net(team->dev),
2874 static int team_nl_send_event_options_get(struct team *team,
2877 return team_nl_send_options_get(team, 0, 0, 0, team_nl_send_multicast,
2881 static int team_nl_send_event_port_get(struct team *team,
2884 return team_nl_send_port_list_get(team, 0, 0, 0, team_nl_send_multicast,
2903 static void __team_options_change_check(struct team *team)
2909 list_for_each_entry(opt_inst, &team->option_inst_list, list) {
2913 err = team_nl_send_event_options_get(team, &sel_opt_inst_list);
2915 netdev_warn(team->dev, "Failed to send options change via netlink (err %d)\n",
2942 err = team_nl_send_event_port_get(port->team, port);
2944 netdev_warn(port->team->dev, "Failed to send port change of device %s via netlink (err %d)\n",
2949 static void __team_carrier_check(struct team *team)
2954 if (team->user_carrier_enabled)
2958 list_for_each_entry(port, &team->port_list, list) {
2966 netif_carrier_on(team->dev);
2968 netif_carrier_off(team->dev);
2975 __team_carrier_check(port->team);
2981 __team_carrier_check(port->team);
2988 __team_carrier_check(port->team);
2993 struct team *team = port->team;
2995 mutex_lock(&team->lock);
2997 mutex_unlock(&team->lock);
3029 team_del_slave(port->team->dev, dev);
3032 if (!port->team->notifier_ctx) {
3033 port->team->notifier_ctx = true;
3034 team_compute_features(port->team);
3035 port->team->notifier_ctx = false;
3040 if (!port->team->port_mtu_change_allowed)
3048 call_netdevice_notifiers(event, port->team->dev);
3100 MODULE_DESCRIPTION("Ethernet team device driver");