Lines Matching refs:team
3 * drivers/net/team/team.c - Network team device driver
31 #define DRV_NAME "team"
64 static int team_port_set_team_dev_addr(struct team *team,
67 return __set_port_dev_addr(port->dev, team->dev->dev_addr);
70 int team_modeop_port_enter(struct team *team, struct team_port *port)
72 return team_port_set_team_dev_addr(team, port);
76 void team_modeop_port_change_dev_addr(struct team *team,
79 team_port_set_team_dev_addr(team, port);
117 static struct team_option *__team_find_option(struct team *team,
122 list_for_each_entry(option, &team->option_list, list) {
135 static void __team_option_inst_del_option(struct team *team,
140 list_for_each_entry_safe(opt_inst, tmp, &team->option_inst_list, list) {
146 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 option->init(team, &opt_inst->info);
174 static int __team_option_inst_add_option(struct team *team,
180 err = __team_option_inst_add(team, option, NULL);
187 __team_option_inst_del_option(team, option);
191 static void __team_option_inst_mark_removed_option(struct team *team,
196 list_for_each_entry(opt_inst, &team->option_inst_list, list) {
204 static void __team_option_inst_del_port(struct team *team,
209 list_for_each_entry_safe(opt_inst, tmp, &team->option_inst_list, list) {
216 static int __team_option_inst_add_port(struct team *team,
222 list_for_each_entry(option, &team->option_list, list) {
225 err = __team_option_inst_add(team, option, port);
232 __team_option_inst_del_port(team, port);
236 static void __team_option_inst_mark_removed_port(struct team *team,
241 list_for_each_entry(opt_inst, &team->option_inst_list, list) {
249 static int __team_options_register(struct team *team,
262 if (__team_find_option(team, option->name)) {
274 err = __team_option_inst_add_option(team, dst_opts[i]);
277 list_add_tail(&dst_opts[i]->list, &team->option_list);
285 __team_option_inst_del_option(team, dst_opts[i]);
298 static void __team_options_mark_removed(struct team *team,
307 del_opt = __team_find_option(team, option->name);
309 __team_option_inst_mark_removed_option(team, del_opt);
313 static void __team_options_unregister(struct team *team,
322 del_opt = __team_find_option(team, option->name);
324 __team_option_inst_del_option(team, del_opt);
331 static void __team_options_change_check(struct team *team);
333 int team_options_register(struct team *team,
339 err = __team_options_register(team, option, option_count);
342 __team_options_change_check(team);
347 void team_options_unregister(struct team *team,
351 __team_options_mark_removed(team, option, option_count);
352 __team_options_change_check(team);
353 __team_options_unregister(team, option, option_count);
357 static int team_option_get(struct team *team,
364 opt_inst->option->getter(team, ctx);
368 static int team_option_set(struct team *team,
374 return opt_inst->option->setter(team, ctx);
386 void team_options_change_check(struct team *team)
388 __team_options_change_check(team);
479 request_module("team-mode-%s", kind);
499 static bool team_dummy_transmit(struct team *team, struct sk_buff *skb)
505 static rx_handler_result_t team_dummy_receive(struct team *team,
516 static bool team_is_mode_set(struct team *team)
518 return team->mode != &__team_no_mode;
521 static void team_set_no_mode(struct team *team)
523 team->user_carrier_enabled = false;
524 team->mode = &__team_no_mode;
527 static void team_adjust_ops(struct team *team)
534 if (!team->en_port_count || !team_is_mode_set(team) ||
535 !team->mode->ops->transmit)
536 team->ops.transmit = team_dummy_transmit;
538 team->ops.transmit = team->mode->ops->transmit;
540 if (!team->en_port_count || !team_is_mode_set(team) ||
541 !team->mode->ops->receive)
542 team->ops.receive = team_dummy_receive;
544 team->ops.receive = team->mode->ops->receive;
552 static int __team_change_mode(struct team *team,
556 if (team_is_mode_set(team)) {
557 void (*exit_op)(struct team *team) = team->ops.exit;
560 memset(&team->ops, 0, sizeof(struct team_mode_ops));
561 team_adjust_ops(team);
564 exit_op(team);
565 team_mode_put(team->mode);
566 team_set_no_mode(team);
568 memset(&team->mode_priv, 0,
569 sizeof(struct team) - offsetof(struct team, mode_priv));
578 err = new_mode->ops->init(team);
583 team->mode = new_mode;
584 memcpy(&team->ops, new_mode->ops, sizeof(struct team_mode_ops));
585 team_adjust_ops(team);
590 static int team_change_mode(struct team *team, const char *kind)
593 struct net_device *dev = team->dev;
596 if (!list_empty(&team->port_list)) {
601 if (team_is_mode_set(team) && strcmp(team->mode->kind, kind) == 0) {
602 netdev_err(dev, "Unable to change to the same mode the team is in\n");
612 err = __team_change_mode(team, new_mode);
630 struct team *team;
633 team = container_of(work, struct team, notify_peers.dw.work);
636 schedule_delayed_work(&team->notify_peers.dw, 0);
639 val = atomic_dec_if_positive(&team->notify_peers.count_pending);
644 call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, team->dev);
647 schedule_delayed_work(&team->notify_peers.dw,
648 msecs_to_jiffies(team->notify_peers.interval));
651 static void team_notify_peers(struct team *team)
653 if (!team->notify_peers.count || !netif_running(team->dev))
655 atomic_add(team->notify_peers.count, &team->notify_peers.count_pending);
656 schedule_delayed_work(&team->notify_peers.dw, 0);
659 static void team_notify_peers_init(struct team *team)
661 INIT_DELAYED_WORK(&team->notify_peers.dw, team_notify_peers_work);
664 static void team_notify_peers_fini(struct team *team)
666 cancel_delayed_work_sync(&team->notify_peers.dw);
676 struct team *team;
679 team = container_of(work, struct team, mcast_rejoin.dw.work);
682 schedule_delayed_work(&team->mcast_rejoin.dw, 0);
685 val = atomic_dec_if_positive(&team->mcast_rejoin.count_pending);
690 call_netdevice_notifiers(NETDEV_RESEND_IGMP, team->dev);
693 schedule_delayed_work(&team->mcast_rejoin.dw,
694 msecs_to_jiffies(team->mcast_rejoin.interval));
697 static void team_mcast_rejoin(struct team *team)
699 if (!team->mcast_rejoin.count || !netif_running(team->dev))
701 atomic_add(team->mcast_rejoin.count, &team->mcast_rejoin.count_pending);
702 schedule_delayed_work(&team->mcast_rejoin.dw, 0);
705 static void team_mcast_rejoin_init(struct team *team)
707 INIT_DELAYED_WORK(&team->mcast_rejoin.dw, team_mcast_rejoin_work);
710 static void team_mcast_rejoin_fini(struct team *team)
712 cancel_delayed_work_sync(&team->mcast_rejoin.dw);
725 struct team *team;
735 team = port->team;
745 res = team->ops.receive(team, port, skb);
750 pcpu_stats = this_cpu_ptr(team->pcpu_stats);
758 skb->dev = team->dev;
760 this_cpu_inc(team->pcpu_stats->rx_nohandler);
762 this_cpu_inc(team->pcpu_stats->rx_dropped);
773 static int team_queue_override_init(struct team *team)
776 unsigned int queue_cnt = team->dev->num_tx_queues - 1;
785 team->qom_lists = listarr;
791 static void team_queue_override_fini(struct team *team)
793 kfree(team->qom_lists);
796 static struct list_head *__team_get_qom_list(struct team *team, u16 queue_id)
798 return &team->qom_lists[queue_id - 1];
804 static bool team_queue_override_transmit(struct team *team, struct sk_buff *skb)
809 if (!team->queue_override_enabled || !skb->queue_mapping)
811 qom_list = __team_get_qom_list(team, skb->queue_mapping);
813 if (!team_dev_queue_xmit(team, port, skb))
819 static void __team_queue_override_port_del(struct team *team,
839 static void __team_queue_override_port_add(struct team *team,
848 qom_list = __team_get_qom_list(team, port->queue_id);
858 static void __team_queue_override_enabled_check(struct team *team)
863 list_for_each_entry(port, &team->port_list, list) {
869 if (enabled == team->queue_override_enabled)
871 netdev_dbg(team->dev, "%s queue override\n",
873 team->queue_override_enabled = enabled;
876 static void team_queue_override_port_prio_changed(struct team *team,
881 __team_queue_override_port_del(team, port);
882 __team_queue_override_port_add(team, port);
883 __team_queue_override_enabled_check(team);
886 static void team_queue_override_port_change_queue_id(struct team *team,
891 __team_queue_override_port_del(team, port);
893 __team_queue_override_port_add(team, port);
894 __team_queue_override_enabled_check(team);
900 static void team_queue_override_port_add(struct team *team,
903 __team_queue_override_port_add(team, port);
904 __team_queue_override_enabled_check(team);
907 static void team_queue_override_port_del(struct team *team,
910 __team_queue_override_port_del(team, port);
911 __team_queue_override_enabled_check(team);
919 static bool team_port_find(const struct team *team,
924 list_for_each_entry(cur, &team->port_list, list)
934 * by team->lock.
936 static void team_port_enable(struct team *team,
941 port->index = team->en_port_count++;
943 team_port_index_hash(team, port->index));
944 team_adjust_ops(team);
945 team_queue_override_port_add(team, port);
946 if (team->ops.port_enabled)
947 team->ops.port_enabled(team, port);
948 team_notify_peers(team);
949 team_mcast_rejoin(team);
953 static void __reconstruct_port_hlist(struct team *team, int rm_index)
958 for (i = rm_index + 1; i < team->en_port_count; i++) {
959 port = team_get_port_by_index(team, i);
963 team_port_index_hash(team, port->index));
967 static void team_port_disable(struct team *team,
972 if (team->ops.port_disabled)
973 team->ops.port_disabled(team, port);
975 __reconstruct_port_hlist(team, port->index);
977 team->en_port_count--;
978 team_queue_override_port_del(team, port);
979 team_adjust_ops(team);
990 static void __team_compute_features(struct team *team)
1001 list_for_each_entry_rcu(port, &team->port_list, list) {
1017 team->dev->vlan_features = vlan_features;
1018 team->dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL |
1021 team->dev->hard_header_len = max_hard_header_len;
1023 team->dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
1025 team->dev->priv_flags |= IFF_XMIT_DST_RELEASE;
1028 static void team_compute_features(struct team *team)
1030 __team_compute_features(team);
1031 netdev_change_features(team->dev);
1034 static int team_port_enter(struct team *team, struct team_port *port)
1038 dev_hold(team->dev);
1039 if (team->ops.port_enter) {
1040 err = team->ops.port_enter(team, port);
1042 netdev_err(team->dev, "Device %s failed to enter team mode\n",
1051 dev_put(team->dev);
1056 static void team_port_leave(struct team *team, struct team_port *port)
1058 if (team->ops.port_leave)
1059 team->ops.port_leave(team, port);
1060 dev_put(team->dev);
1084 if (!port->team->dev->npinfo)
1110 static int team_upper_dev_link(struct team *team, struct team_port *port,
1116 lag_upper_info.tx_type = team->mode->lag_tx_type;
1118 err = netdev_master_upper_dev_link(port->dev, team->dev, NULL,
1126 static void team_upper_dev_unlink(struct team *team, struct team_port *port)
1128 netdev_upper_dev_unlink(port->dev, team->dev);
1136 static int team_port_add(struct team *team, struct net_device *port_dev,
1139 struct net_device *dev = team->dev;
1145 NL_SET_ERR_MSG(extack, "Loopback device can't be added as a team port");
1146 netdev_err(dev, "Device %s is loopback device. Loopback devices can't be added as a team port\n",
1152 NL_SET_ERR_MSG(extack, "Device is already a port of a team device");
1154 "of a team device\n", portname);
1159 NL_SET_ERR_MSG(extack, "Cannot enslave team device to itself");
1160 netdev_err(dev, "Cannot enslave team device to itself\n");
1165 NL_SET_ERR_MSG(extack, "Device is already an upper device of the team interface");
1166 netdev_err(dev, "Device %s is already an upper device of the team interface\n",
1173 NL_SET_ERR_MSG(extack, "Device is VLAN challenged and team device has VLAN set up");
1174 netdev_err(dev, "Device %s is VLAN challenged and team device has VLAN set up\n",
1184 NL_SET_ERR_MSG(extack, "Device is up. Set it down before adding it as a team port");
1185 netdev_err(dev, "Device %s is up. Set it down before adding it as a team port\n",
1190 port = kzalloc(sizeof(struct team_port) + team->mode->port_priv_size,
1196 port->team = team;
1208 err = team_port_enter(team, port);
1210 netdev_err(dev, "Device %s failed to enter team mode\n",
1247 err = team_upper_dev_link(team, port, extack);
1254 err = __team_option_inst_add_port(team, port);
1286 list_add_tail_rcu(&port->list, &team->port_list);
1287 team_port_enable(team, port);
1288 __team_compute_features(team);
1290 __team_options_change_check(team);
1297 __team_option_inst_del_port(team, port);
1300 team_upper_dev_unlink(team, port);
1315 team_port_leave(team, port);
1329 static int team_port_del(struct team *team, struct net_device *port_dev)
1331 struct net_device *dev = team->dev;
1336 if (!port || !team_port_find(team, port)) {
1337 netdev_err(dev, "Device %s does not act as a port of this team\n",
1342 team_port_disable(team, port);
1350 team_upper_dev_unlink(team, port);
1359 team_port_leave(team, port);
1361 __team_option_inst_mark_removed_port(team, port);
1362 __team_options_change_check(team);
1363 __team_option_inst_del_port(team, port);
1370 __team_compute_features(team);
1380 static void team_mode_option_get(struct team *team, struct team_gsetter_ctx *ctx)
1382 ctx->data.str_val = team->mode->kind;
1385 static int team_mode_option_set(struct team *team, struct team_gsetter_ctx *ctx)
1387 return team_change_mode(team, ctx->data.str_val);
1390 static void team_notify_peers_count_get(struct team *team,
1393 ctx->data.u32_val = team->notify_peers.count;
1396 static int team_notify_peers_count_set(struct team *team,
1399 team->notify_peers.count = ctx->data.u32_val;
1403 static void team_notify_peers_interval_get(struct team *team,
1406 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 void team_mcast_rejoin_count_get(struct team *team,
1419 ctx->data.u32_val = team->mcast_rejoin.count;
1422 static int team_mcast_rejoin_count_set(struct team *team,
1425 team->mcast_rejoin.count = ctx->data.u32_val;
1429 static void team_mcast_rejoin_interval_get(struct team *team,
1432 ctx->data.u32_val = team->mcast_rejoin.interval;
1435 static int team_mcast_rejoin_interval_set(struct team *team,
1438 team->mcast_rejoin.interval = ctx->data.u32_val;
1442 static void team_port_en_option_get(struct team *team,
1450 static int team_port_en_option_set(struct team *team,
1456 team_port_enable(team, port);
1458 team_port_disable(team, port);
1462 static void team_user_linkup_option_get(struct team *team,
1470 static void __team_carrier_check(struct team *team);
1472 static int team_user_linkup_option_set(struct team *team,
1479 __team_carrier_check(port->team);
1483 static void team_user_linkup_en_option_get(struct team *team,
1491 static int team_user_linkup_en_option_set(struct team *team,
1498 __team_carrier_check(port->team);
1502 static void team_priority_option_get(struct team *team,
1510 static int team_priority_option_set(struct team *team,
1519 team_queue_override_port_prio_changed(team, port);
1523 static void team_queue_id_option_get(struct team *team,
1531 static int team_queue_id_option_set(struct team *team,
1539 if (new_queue_id >= team->dev->real_num_tx_queues)
1541 team_queue_override_port_change_queue_id(team, port, new_queue_id);
1616 struct team *team = netdev_priv(dev);
1620 team->dev = dev;
1621 team_set_no_mode(team);
1622 team->notifier_ctx = false;
1624 team->pcpu_stats = netdev_alloc_pcpu_stats(struct team_pcpu_stats);
1625 if (!team->pcpu_stats)
1629 INIT_HLIST_HEAD(&team->en_port_hlist[i]);
1630 INIT_LIST_HEAD(&team->port_list);
1631 err = team_queue_override_init(team);
1635 team_adjust_ops(team);
1637 INIT_LIST_HEAD(&team->option_list);
1638 INIT_LIST_HEAD(&team->option_inst_list);
1640 team_notify_peers_init(team);
1641 team_mcast_rejoin_init(team);
1643 err = team_options_register(team, team_options, ARRAY_SIZE(team_options));
1648 lockdep_register_key(&team->team_lock_key);
1649 __mutex_init(&team->lock, "team->team_lock_key", &team->team_lock_key);
1655 team_mcast_rejoin_fini(team);
1656 team_notify_peers_fini(team);
1657 team_queue_override_fini(team);
1659 free_percpu(team->pcpu_stats);
1666 struct team *team = netdev_priv(dev);
1670 mutex_lock(&team->lock);
1671 list_for_each_entry_safe(port, tmp, &team->port_list, list)
1672 team_port_del(team, port->dev);
1674 __team_change_mode(team, NULL); /* cleanup */
1675 __team_options_unregister(team, team_options, ARRAY_SIZE(team_options));
1676 team_mcast_rejoin_fini(team);
1677 team_notify_peers_fini(team);
1678 team_queue_override_fini(team);
1679 mutex_unlock(&team->lock);
1681 lockdep_unregister_key(&team->team_lock_key);
1686 struct team *team = netdev_priv(dev);
1688 free_percpu(team->pcpu_stats);
1698 struct team *team = netdev_priv(dev);
1701 list_for_each_entry(port, &team->port_list, list) {
1714 struct team *team = netdev_priv(dev);
1718 tx_success = team_queue_override_transmit(team, skb);
1720 tx_success = team->ops.transmit(team, skb);
1724 pcpu_stats = this_cpu_ptr(team->pcpu_stats);
1730 this_cpu_inc(team->pcpu_stats->tx_dropped);
1743 * way down to the team driver.
1762 struct team *team = netdev_priv(dev);
1767 list_for_each_entry_rcu(port, &team->port_list, list) {
1782 struct team *team = netdev_priv(dev);
1786 list_for_each_entry_rcu(port, &team->port_list, list) {
1796 struct team *team = netdev_priv(dev);
1802 mutex_lock(&team->lock);
1803 list_for_each_entry(port, &team->port_list, list)
1804 if (team->ops.port_change_dev_addr)
1805 team->ops.port_change_dev_addr(team, port);
1806 mutex_unlock(&team->lock);
1812 struct team *team = netdev_priv(dev);
1817 * Alhough this is reader, it's guarded by team lock. It's not possible
1820 mutex_lock(&team->lock);
1821 team->port_mtu_change_allowed = true;
1822 list_for_each_entry(port, &team->port_list, list) {
1830 team->port_mtu_change_allowed = false;
1831 mutex_unlock(&team->lock);
1838 list_for_each_entry_continue_reverse(port, &team->port_list, list)
1840 team->port_mtu_change_allowed = false;
1841 mutex_unlock(&team->lock);
1849 struct team *team = netdev_priv(dev);
1857 p = per_cpu_ptr(team->pcpu_stats, i);
1887 struct team *team = netdev_priv(dev);
1892 * Alhough this is reader, it's guarded by team lock. It's not possible
1895 mutex_lock(&team->lock);
1896 list_for_each_entry(port, &team->port_list, list) {
1901 mutex_unlock(&team->lock);
1906 list_for_each_entry_continue_reverse(port, &team->port_list, list)
1908 mutex_unlock(&team->lock);
1915 struct team *team = netdev_priv(dev);
1918 mutex_lock(&team->lock);
1919 list_for_each_entry(port, &team->port_list, list)
1921 mutex_unlock(&team->lock);
1931 static void __team_netpoll_cleanup(struct team *team)
1935 list_for_each_entry(port, &team->port_list, list)
1941 struct team *team = netdev_priv(dev);
1943 mutex_lock(&team->lock);
1944 __team_netpoll_cleanup(team);
1945 mutex_unlock(&team->lock);
1951 struct team *team = netdev_priv(dev);
1955 mutex_lock(&team->lock);
1956 list_for_each_entry(port, &team->port_list, list) {
1959 __team_netpoll_cleanup(team);
1963 mutex_unlock(&team->lock);
1971 struct team *team = netdev_priv(dev);
1974 mutex_lock(&team->lock);
1975 err = team_port_add(team, port_dev, extack);
1976 mutex_unlock(&team->lock);
1986 struct team *team = netdev_priv(dev);
1989 mutex_lock(&team->lock);
1990 err = team_port_del(team, port_dev);
1991 mutex_unlock(&team->lock);
1997 lockdep_unregister_key(&team->team_lock_key);
1998 lockdep_register_key(&team->team_lock_key);
1999 lockdep_set_class(&team->lock, &team->team_lock_key);
2010 struct team *team = netdev_priv(dev);
2018 list_for_each_entry_rcu(port, &team->port_list, list) {
2032 struct team *team = netdev_priv(dev);
2034 team->user_carrier_enabled = true;
2083 struct team *team= netdev_priv(dev);
2091 list_for_each_entry_rcu(port, &team->port_list, list) {
2120 struct team *team = netdev_priv(dev);
2123 dev->header_ops = team->header_ops_cache;
2147 struct team *team = netdev_priv(dev);
2153 if (!list_empty(&team->port_list)) {
2172 struct team *team = netdev_priv(dev);
2176 team->header_ops_cache = dev->header_ops;
2196 /* Don't allow team devices to change network namespaces. */
2244 .priv_size = sizeof(struct team),
2311 static struct team *team_nl_team_get(struct genl_info *info)
2316 struct team *team;
2328 team = netdev_priv(dev);
2329 mutex_lock(&team->lock);
2330 return team;
2333 static void team_nl_team_put(struct team *team)
2335 mutex_unlock(&team->lock);
2336 dev_put(team->dev);
2340 struct team *team, u32 portid);
2342 static int team_nl_send_unicast(struct sk_buff *skb, struct team *team, u32 portid)
2344 return genlmsg_unicast(dev_net(team->dev), skb, portid);
2347 static int team_nl_fill_one_option_get(struct sk_buff *skb, struct team *team,
2357 err = team_option_get(team, opt_inst, &ctx);
2429 struct team *team, u32 portid,
2435 err = send_func(*pskb, team, portid);
2445 static int team_nl_send_options_get(struct team *team, u32 portid, u32 seq,
2462 err = __send_and_alloc_skb(&skb, team, portid, send_func);
2473 if (nla_put_u32(skb, TEAM_ATTR_TEAM_IFINDEX, team->dev->ifindex))
2482 err = team_nl_fill_one_option_get(skb, team, opt_inst);
2503 err = __send_and_alloc_skb(&skb, team, portid, send_func);
2509 return send_func(skb, team, portid);
2520 struct team *team;
2525 team = team_nl_team_get(info);
2526 if (!team)
2529 list_for_each_entry(opt_inst, &team->option_inst_list, list)
2531 err = team_nl_send_options_get(team, info->snd_portid, info->snd_seq,
2535 team_nl_team_put(team);
2540 static int team_nl_send_event_options_get(struct team *team,
2545 struct team *team;
2552 team = team_nl_team_get(info);
2553 if (!team) {
2630 list_for_each_entry(opt_inst, &team->option_inst_list, list) {
2671 err = team_option_set(team, opt_inst, &ctx);
2682 err = team_nl_send_event_options_get(team, &opt_inst_list);
2688 team_nl_team_put(team);
2724 static int team_nl_send_port_list_get(struct team *team, u32 portid, u32 seq,
2737 port = list_first_entry_or_null(&team->port_list,
2741 err = __send_and_alloc_skb(&skb, team, portid, send_func);
2752 if (nla_put_u32(skb, TEAM_ATTR_TEAM_IFINDEX, team->dev->ifindex))
2769 list_for_each_entry_from(port, &team->port_list, list) {
2792 err = __send_and_alloc_skb(&skb, team, portid, send_func);
2798 return send_func(skb, team, portid);
2810 struct team *team;
2813 team = team_nl_team_get(info);
2814 if (!team)
2817 err = team_nl_send_port_list_get(team, info->snd_portid, info->snd_seq,
2820 team_nl_team_put(team);
2870 struct team *team, u32 portid)
2872 return genlmsg_multicast_netns(&team_nl_family, dev_net(team->dev),
2876 static int team_nl_send_event_options_get(struct team *team,
2879 return team_nl_send_options_get(team, 0, 0, 0, team_nl_send_multicast,
2883 static int team_nl_send_event_port_get(struct team *team,
2886 return team_nl_send_port_list_get(team, 0, 0, 0, team_nl_send_multicast,
2905 static void __team_options_change_check(struct team *team)
2911 list_for_each_entry(opt_inst, &team->option_inst_list, list) {
2915 err = team_nl_send_event_options_get(team, &sel_opt_inst_list);
2917 netdev_warn(team->dev, "Failed to send options change via netlink (err %d)\n",
2944 err = team_nl_send_event_port_get(port->team, port);
2946 netdev_warn(port->team->dev, "Failed to send port change of device %s via netlink (err %d)\n",
2951 static void __team_carrier_check(struct team *team)
2956 if (team->user_carrier_enabled)
2960 list_for_each_entry(port, &team->port_list, list) {
2968 netif_carrier_on(team->dev);
2970 netif_carrier_off(team->dev);
2977 __team_carrier_check(port->team);
2983 __team_carrier_check(port->team);
2990 __team_carrier_check(port->team);
2995 struct team *team = port->team;
2997 mutex_lock(&team->lock);
2999 mutex_unlock(&team->lock);
3031 team_del_slave(port->team->dev, dev);
3034 if (!port->team->notifier_ctx) {
3035 port->team->notifier_ctx = true;
3036 team_compute_features(port->team);
3037 port->team->notifier_ctx = false;
3042 if (!port->team->port_mtu_change_allowed)
3050 call_netdevice_notifiers(event, port->team->dev);
3102 MODULE_DESCRIPTION("Ethernet team device driver");