Lines Matching +full:lower +full:- +full:case
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * net/dsa/slave.c - Slave device handling
4 * Copyright (c) 2008-2009 Marvell Semiconductor
31 const unsigned char *addr = standalone_work->addr; in dsa_slave_standalone_event_work()
32 struct net_device *dev = standalone_work->dev; in dsa_slave_standalone_event_work()
35 struct dsa_switch *ds = dp->ds; in dsa_slave_standalone_event_work()
36 u16 vid = standalone_work->vid; in dsa_slave_standalone_event_work()
39 switch (standalone_work->event) { in dsa_slave_standalone_event_work()
40 case DSA_UC_ADD: in dsa_slave_standalone_event_work()
43 dev_err(ds->dev, in dsa_slave_standalone_event_work()
45 dp->index, addr, vid, err); in dsa_slave_standalone_event_work()
50 case DSA_UC_DEL: in dsa_slave_standalone_event_work()
53 dev_err(ds->dev, in dsa_slave_standalone_event_work()
55 dp->index, addr, vid, err); in dsa_slave_standalone_event_work()
59 case DSA_MC_ADD: in dsa_slave_standalone_event_work()
65 dev_err(ds->dev, in dsa_slave_standalone_event_work()
67 dp->index, addr, vid, err); in dsa_slave_standalone_event_work()
71 case DSA_MC_DEL: in dsa_slave_standalone_event_work()
77 dev_err(ds->dev, in dsa_slave_standalone_event_work()
79 dp->index, addr, vid, err); in dsa_slave_standalone_event_work()
97 return -ENOMEM; in dsa_slave_schedule_standalone_work()
99 INIT_WORK(&standalone_work->work, dsa_slave_standalone_event_work); in dsa_slave_schedule_standalone_work()
100 standalone_work->event = event; in dsa_slave_schedule_standalone_work()
101 standalone_work->dev = dev; in dsa_slave_schedule_standalone_work()
103 ether_addr_copy(standalone_work->addr, addr); in dsa_slave_schedule_standalone_work()
104 standalone_work->vid = vid; in dsa_slave_schedule_standalone_work()
106 dsa_schedule_work(&standalone_work->work); in dsa_slave_schedule_standalone_work()
119 if (!dsa_switch_supports_uc_filtering(dp->ds)) in dsa_slave_sync_uc()
133 if (!dsa_switch_supports_uc_filtering(dp->ds)) in dsa_slave_unsync_uc()
147 if (!dsa_switch_supports_mc_filtering(dp->ds)) in dsa_slave_sync_mc()
161 if (!dsa_switch_supports_mc_filtering(dp->ds)) in dsa_slave_unsync_mc()
170 struct dsa_switch *ds = dp->ds; in dsa_slave_sync_ha()
176 dsa_slave_sync_mc(dev, ha->addr); in dsa_slave_sync_ha()
179 dsa_slave_sync_uc(dev, ha->addr); in dsa_slave_sync_ha()
191 struct dsa_switch *ds = dp->ds; in dsa_slave_unsync_ha()
197 dsa_slave_unsync_uc(dev, ha->addr); in dsa_slave_unsync_ha()
200 dsa_slave_unsync_mc(dev, ha->addr); in dsa_slave_unsync_ha()
212 struct dsa_switch *ds = bus->priv; in dsa_slave_phy_read()
214 if (ds->phys_mii_mask & (1 << addr)) in dsa_slave_phy_read()
215 return ds->ops->phy_read(ds, addr, reg); in dsa_slave_phy_read()
222 struct dsa_switch *ds = bus->priv; in dsa_slave_phy_write()
224 if (ds->phys_mii_mask & (1 << addr)) in dsa_slave_phy_write()
225 return ds->ops->phy_write(ds, addr, reg, val); in dsa_slave_phy_write()
232 ds->slave_mii_bus->priv = (void *)ds; in dsa_slave_mii_bus_init()
233 ds->slave_mii_bus->name = "dsa slave smi"; in dsa_slave_mii_bus_init()
234 ds->slave_mii_bus->read = dsa_slave_phy_read; in dsa_slave_mii_bus_init()
235 ds->slave_mii_bus->write = dsa_slave_phy_write; in dsa_slave_mii_bus_init()
236 snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d.%d", in dsa_slave_mii_bus_init()
237 ds->dst->index, ds->index); in dsa_slave_mii_bus_init()
238 ds->slave_mii_bus->parent = ds->dev; in dsa_slave_mii_bus_init()
239 ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask; in dsa_slave_mii_bus_init()
246 return dsa_slave_to_master(dev)->ifindex; in dsa_slave_get_iflink()
253 struct dsa_switch *ds = dp->ds; in dsa_slave_open()
258 netdev_err(dev, "failed to open master %s\n", master->name); in dsa_slave_open()
263 err = dsa_port_standalone_host_fdb_add(dp, dev->dev_addr, 0); in dsa_slave_open()
268 if (!ether_addr_equal(dev->dev_addr, master->dev_addr)) { in dsa_slave_open()
269 err = dev_uc_add(master, dev->dev_addr); in dsa_slave_open()
274 err = dsa_port_enable_rt(dp, dev->phydev); in dsa_slave_open()
281 if (!ether_addr_equal(dev->dev_addr, master->dev_addr)) in dsa_slave_open()
282 dev_uc_del(master, dev->dev_addr); in dsa_slave_open()
285 dsa_port_standalone_host_fdb_del(dp, dev->dev_addr, 0); in dsa_slave_open()
294 struct dsa_switch *ds = dp->ds; in dsa_slave_close()
298 if (!ether_addr_equal(dev->dev_addr, master->dev_addr)) in dsa_slave_close()
299 dev_uc_del(master, dev->dev_addr); in dsa_slave_close()
302 dsa_port_standalone_host_fdb_del(dp, dev->dev_addr, 0); in dsa_slave_close()
309 bool mc = dev->flags & (IFF_PROMISC | IFF_ALLMULTI); in dsa_slave_manage_host_flood()
311 bool uc = dev->flags & IFF_PROMISC; in dsa_slave_manage_host_flood()
320 struct dsa_switch *ds = dp->ds; in dsa_slave_change_rx_flags()
324 dev->flags & IFF_ALLMULTI ? 1 : -1); in dsa_slave_change_rx_flags()
327 dev->flags & IFF_PROMISC ? 1 : -1); in dsa_slave_change_rx_flags()
344 struct dsa_switch *ds = dp->ds; in dsa_slave_set_mac_address()
348 if (!is_valid_ether_addr(addr->sa_data)) in dsa_slave_set_mac_address()
349 return -EADDRNOTAVAIL; in dsa_slave_set_mac_address()
354 if (!(dev->flags & IFF_UP)) in dsa_slave_set_mac_address()
358 err = dsa_port_standalone_host_fdb_add(dp, addr->sa_data, 0); in dsa_slave_set_mac_address()
363 if (!ether_addr_equal(addr->sa_data, master->dev_addr)) { in dsa_slave_set_mac_address()
364 err = dev_uc_add(master, addr->sa_data); in dsa_slave_set_mac_address()
369 if (!ether_addr_equal(dev->dev_addr, master->dev_addr)) in dsa_slave_set_mac_address()
370 dev_uc_del(master, dev->dev_addr); in dsa_slave_set_mac_address()
373 dsa_port_standalone_host_fdb_del(dp, dev->dev_addr, 0); in dsa_slave_set_mac_address()
376 eth_hw_addr_set(dev, addr->sa_data); in dsa_slave_set_mac_address()
382 dsa_port_standalone_host_fdb_del(dp, addr->sa_data, 0); in dsa_slave_set_mac_address()
399 u32 portid = NETLINK_CB(dump->cb->skb).portid; in dsa_slave_port_fdb_do_dump()
400 u32 seq = dump->cb->nlh->nlmsg_seq; in dsa_slave_port_fdb_do_dump()
404 if (dump->idx < dump->cb->args[2]) in dsa_slave_port_fdb_do_dump()
407 nlh = nlmsg_put(dump->skb, portid, seq, RTM_NEWNEIGH, in dsa_slave_port_fdb_do_dump()
410 return -EMSGSIZE; in dsa_slave_port_fdb_do_dump()
413 ndm->ndm_family = AF_BRIDGE; in dsa_slave_port_fdb_do_dump()
414 ndm->ndm_pad1 = 0; in dsa_slave_port_fdb_do_dump()
415 ndm->ndm_pad2 = 0; in dsa_slave_port_fdb_do_dump()
416 ndm->ndm_flags = NTF_SELF; in dsa_slave_port_fdb_do_dump()
417 ndm->ndm_type = 0; in dsa_slave_port_fdb_do_dump()
418 ndm->ndm_ifindex = dump->dev->ifindex; in dsa_slave_port_fdb_do_dump()
419 ndm->ndm_state = is_static ? NUD_NOARP : NUD_REACHABLE; in dsa_slave_port_fdb_do_dump()
421 if (nla_put(dump->skb, NDA_LLADDR, ETH_ALEN, addr)) in dsa_slave_port_fdb_do_dump()
424 if (vid && nla_put_u16(dump->skb, NDA_VLAN, vid)) in dsa_slave_port_fdb_do_dump()
427 nlmsg_end(dump->skb, nlh); in dsa_slave_port_fdb_do_dump()
430 dump->idx++; in dsa_slave_port_fdb_do_dump()
434 nlmsg_cancel(dump->skb, nlh); in dsa_slave_port_fdb_do_dump()
435 return -EMSGSIZE; in dsa_slave_port_fdb_do_dump()
461 struct dsa_switch *ds = p->dp->ds; in dsa_slave_ioctl()
462 int port = p->dp->index; in dsa_slave_ioctl()
466 case SIOCGHWTSTAMP: in dsa_slave_ioctl()
467 if (ds->ops->port_hwtstamp_get) in dsa_slave_ioctl()
468 return ds->ops->port_hwtstamp_get(ds, port, ifr); in dsa_slave_ioctl()
470 case SIOCSHWTSTAMP: in dsa_slave_ioctl()
471 if (ds->ops->port_hwtstamp_set) in dsa_slave_ioctl()
472 return ds->ops->port_hwtstamp_set(ds, port, ifr); in dsa_slave_ioctl()
476 return phylink_mii_ioctl(p->dp->pl, ifr, cmd); in dsa_slave_ioctl()
489 switch (attr->id) { in dsa_slave_port_attr_set()
490 case SWITCHDEV_ATTR_ID_PORT_STP_STATE: in dsa_slave_port_attr_set()
491 if (!dsa_port_offloads_bridge_port(dp, attr->orig_dev)) in dsa_slave_port_attr_set()
492 return -EOPNOTSUPP; in dsa_slave_port_attr_set()
494 ret = dsa_port_set_state(dp, attr->u.stp_state, true); in dsa_slave_port_attr_set()
496 case SWITCHDEV_ATTR_ID_PORT_MST_STATE: in dsa_slave_port_attr_set()
497 if (!dsa_port_offloads_bridge_port(dp, attr->orig_dev)) in dsa_slave_port_attr_set()
498 return -EOPNOTSUPP; in dsa_slave_port_attr_set()
500 ret = dsa_port_set_mst_state(dp, &attr->u.mst_state, extack); in dsa_slave_port_attr_set()
502 case SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING: in dsa_slave_port_attr_set()
503 if (!dsa_port_offloads_bridge_dev(dp, attr->orig_dev)) in dsa_slave_port_attr_set()
504 return -EOPNOTSUPP; in dsa_slave_port_attr_set()
506 ret = dsa_port_vlan_filtering(dp, attr->u.vlan_filtering, in dsa_slave_port_attr_set()
509 case SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME: in dsa_slave_port_attr_set()
510 if (!dsa_port_offloads_bridge_dev(dp, attr->orig_dev)) in dsa_slave_port_attr_set()
511 return -EOPNOTSUPP; in dsa_slave_port_attr_set()
513 ret = dsa_port_ageing_time(dp, attr->u.ageing_time); in dsa_slave_port_attr_set()
515 case SWITCHDEV_ATTR_ID_BRIDGE_MST: in dsa_slave_port_attr_set()
516 if (!dsa_port_offloads_bridge_dev(dp, attr->orig_dev)) in dsa_slave_port_attr_set()
517 return -EOPNOTSUPP; in dsa_slave_port_attr_set()
519 ret = dsa_port_mst_enable(dp, attr->u.mst, extack); in dsa_slave_port_attr_set()
521 case SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS: in dsa_slave_port_attr_set()
522 if (!dsa_port_offloads_bridge_port(dp, attr->orig_dev)) in dsa_slave_port_attr_set()
523 return -EOPNOTSUPP; in dsa_slave_port_attr_set()
525 ret = dsa_port_pre_bridge_flags(dp, attr->u.brport_flags, in dsa_slave_port_attr_set()
528 case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS: in dsa_slave_port_attr_set()
529 if (!dsa_port_offloads_bridge_port(dp, attr->orig_dev)) in dsa_slave_port_attr_set()
530 return -EOPNOTSUPP; in dsa_slave_port_attr_set()
532 ret = dsa_port_bridge_flags(dp, attr->u.brport_flags, extack); in dsa_slave_port_attr_set()
534 case SWITCHDEV_ATTR_ID_VLAN_MSTI: in dsa_slave_port_attr_set()
535 if (!dsa_port_offloads_bridge_dev(dp, attr->orig_dev)) in dsa_slave_port_attr_set()
536 return -EOPNOTSUPP; in dsa_slave_port_attr_set()
538 ret = dsa_port_vlan_msti(dp, &attr->u.vlan_msti); in dsa_slave_port_attr_set()
541 ret = -EOPNOTSUPP; in dsa_slave_port_attr_set()
563 if (vid == vlan->vid) in dsa_slave_vlan_check_for_8021q_uppers()
564 return -EBUSY; in dsa_slave_vlan_check_for_8021q_uppers()
613 if (!dp->bridge) in dsa_slave_host_vlan_add()
614 return -EOPNOTSUPP; in dsa_slave_host_vlan_add()
641 switch (obj->id) { in dsa_slave_port_obj_add()
642 case SWITCHDEV_OBJ_ID_PORT_MDB: in dsa_slave_port_obj_add()
643 if (!dsa_port_offloads_bridge_port(dp, obj->orig_dev)) in dsa_slave_port_obj_add()
644 return -EOPNOTSUPP; in dsa_slave_port_obj_add()
648 case SWITCHDEV_OBJ_ID_HOST_MDB: in dsa_slave_port_obj_add()
649 if (!dsa_port_offloads_bridge_dev(dp, obj->orig_dev)) in dsa_slave_port_obj_add()
650 return -EOPNOTSUPP; in dsa_slave_port_obj_add()
654 case SWITCHDEV_OBJ_ID_PORT_VLAN: in dsa_slave_port_obj_add()
655 if (dsa_port_offloads_bridge_port(dp, obj->orig_dev)) in dsa_slave_port_obj_add()
660 case SWITCHDEV_OBJ_ID_MRP: in dsa_slave_port_obj_add()
661 if (!dsa_port_offloads_bridge_dev(dp, obj->orig_dev)) in dsa_slave_port_obj_add()
662 return -EOPNOTSUPP; in dsa_slave_port_obj_add()
666 case SWITCHDEV_OBJ_ID_RING_ROLE_MRP: in dsa_slave_port_obj_add()
667 if (!dsa_port_offloads_bridge_dev(dp, obj->orig_dev)) in dsa_slave_port_obj_add()
668 return -EOPNOTSUPP; in dsa_slave_port_obj_add()
674 err = -EOPNOTSUPP; in dsa_slave_port_obj_add()
702 if (!dp->bridge) in dsa_slave_host_vlan_del()
703 return -EOPNOTSUPP; in dsa_slave_host_vlan_del()
722 switch (obj->id) { in dsa_slave_port_obj_del()
723 case SWITCHDEV_OBJ_ID_PORT_MDB: in dsa_slave_port_obj_del()
724 if (!dsa_port_offloads_bridge_port(dp, obj->orig_dev)) in dsa_slave_port_obj_del()
725 return -EOPNOTSUPP; in dsa_slave_port_obj_del()
729 case SWITCHDEV_OBJ_ID_HOST_MDB: in dsa_slave_port_obj_del()
730 if (!dsa_port_offloads_bridge_dev(dp, obj->orig_dev)) in dsa_slave_port_obj_del()
731 return -EOPNOTSUPP; in dsa_slave_port_obj_del()
735 case SWITCHDEV_OBJ_ID_PORT_VLAN: in dsa_slave_port_obj_del()
736 if (dsa_port_offloads_bridge_port(dp, obj->orig_dev)) in dsa_slave_port_obj_del()
741 case SWITCHDEV_OBJ_ID_MRP: in dsa_slave_port_obj_del()
742 if (!dsa_port_offloads_bridge_dev(dp, obj->orig_dev)) in dsa_slave_port_obj_del()
743 return -EOPNOTSUPP; in dsa_slave_port_obj_del()
747 case SWITCHDEV_OBJ_ID_RING_ROLE_MRP: in dsa_slave_port_obj_del()
748 if (!dsa_port_offloads_bridge_dev(dp, obj->orig_dev)) in dsa_slave_port_obj_del()
749 return -EOPNOTSUPP; in dsa_slave_port_obj_del()
755 err = -EOPNOTSUPP; in dsa_slave_port_obj_del()
768 return netpoll_send_skb(p->netpoll, skb); in dsa_slave_netpoll_send_skb()
778 struct dsa_switch *ds = p->dp->ds; in dsa_skb_tx_timestamp()
780 if (!(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) in dsa_skb_tx_timestamp()
783 if (!ds->ops->port_txtstamp) in dsa_skb_tx_timestamp()
786 ds->ops->port_txtstamp(ds, p->dp->index, skb); in dsa_skb_tx_timestamp()
791 /* SKB for netpoll still need to be mangled with the protocol-specific in dsa_enqueue_skb()
800 skb->dev = dsa_slave_to_master(dev); in dsa_enqueue_skb()
809 int needed_headroom = dev->needed_headroom; in dsa_realloc_skb()
810 int needed_tailroom = dev->needed_tailroom; in dsa_realloc_skb()
817 if (unlikely(needed_tailroom && skb->len < ETH_ZLEN)) in dsa_realloc_skb()
818 needed_tailroom += ETH_ZLEN - skb->len; in dsa_realloc_skb()
820 needed_headroom = max_t(int, needed_headroom - skb_headroom(skb), 0); in dsa_realloc_skb()
821 needed_tailroom = max_t(int, needed_tailroom - skb_tailroom(skb), 0); in dsa_realloc_skb()
836 dev_sw_netstats_tx_add(dev, 1, skb->len); in dsa_slave_xmit()
838 memset(skb->cb, 0, sizeof(skb->cb)); in dsa_slave_xmit()
851 if (dev->needed_tailroom) in dsa_slave_xmit()
855 * in which case it must have freed it. Only free it here on error. in dsa_slave_xmit()
857 nskb = p->xmit(skb, dev); in dsa_slave_xmit()
871 strscpy(drvinfo->driver, "dsa", sizeof(drvinfo->driver)); in dsa_slave_get_drvinfo()
872 strscpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version)); in dsa_slave_get_drvinfo()
873 strscpy(drvinfo->bus_info, "platform", sizeof(drvinfo->bus_info)); in dsa_slave_get_drvinfo()
879 struct dsa_switch *ds = dp->ds; in dsa_slave_get_regs_len()
881 if (ds->ops->get_regs_len) in dsa_slave_get_regs_len()
882 return ds->ops->get_regs_len(ds, dp->index); in dsa_slave_get_regs_len()
884 return -EOPNOTSUPP; in dsa_slave_get_regs_len()
891 struct dsa_switch *ds = dp->ds; in dsa_slave_get_regs()
893 if (ds->ops->get_regs) in dsa_slave_get_regs()
894 ds->ops->get_regs(ds, dp->index, regs, _p); in dsa_slave_get_regs()
901 return phylink_ethtool_nway_reset(dp->pl); in dsa_slave_nway_reset()
907 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eeprom_len()
909 if (ds->cd && ds->cd->eeprom_len) in dsa_slave_get_eeprom_len()
910 return ds->cd->eeprom_len; in dsa_slave_get_eeprom_len()
912 if (ds->ops->get_eeprom_len) in dsa_slave_get_eeprom_len()
913 return ds->ops->get_eeprom_len(ds); in dsa_slave_get_eeprom_len()
922 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eeprom()
924 if (ds->ops->get_eeprom) in dsa_slave_get_eeprom()
925 return ds->ops->get_eeprom(ds, eeprom, data); in dsa_slave_get_eeprom()
927 return -EOPNOTSUPP; in dsa_slave_get_eeprom()
934 struct dsa_switch *ds = dp->ds; in dsa_slave_set_eeprom()
936 if (ds->ops->set_eeprom) in dsa_slave_set_eeprom()
937 return ds->ops->set_eeprom(ds, eeprom, data); in dsa_slave_set_eeprom()
939 return -EOPNOTSUPP; in dsa_slave_set_eeprom()
946 struct dsa_switch *ds = dp->ds; in dsa_slave_get_strings()
955 if (ds->ops->get_strings) in dsa_slave_get_strings()
956 ds->ops->get_strings(ds, dp->index, stringset, in dsa_slave_get_strings()
969 struct dsa_switch *ds = dp->ds; in dsa_slave_get_ethtool_stats()
977 s = per_cpu_ptr(dev->tstats, i); in dsa_slave_get_ethtool_stats()
979 start = u64_stats_fetch_begin_irq(&s->syncp); in dsa_slave_get_ethtool_stats()
980 tx_packets = u64_stats_read(&s->tx_packets); in dsa_slave_get_ethtool_stats()
981 tx_bytes = u64_stats_read(&s->tx_bytes); in dsa_slave_get_ethtool_stats()
982 rx_packets = u64_stats_read(&s->rx_packets); in dsa_slave_get_ethtool_stats()
983 rx_bytes = u64_stats_read(&s->rx_bytes); in dsa_slave_get_ethtool_stats()
984 } while (u64_stats_fetch_retry_irq(&s->syncp, start)); in dsa_slave_get_ethtool_stats()
990 if (ds->ops->get_ethtool_stats) in dsa_slave_get_ethtool_stats()
991 ds->ops->get_ethtool_stats(ds, dp->index, data + 4); in dsa_slave_get_ethtool_stats()
997 struct dsa_switch *ds = dp->ds; in dsa_slave_get_sset_count()
1002 if (ds->ops->get_sset_count) { in dsa_slave_get_sset_count()
1003 count = ds->ops->get_sset_count(ds, dp->index, sset); in dsa_slave_get_sset_count()
1013 return -EOPNOTSUPP; in dsa_slave_get_sset_count()
1020 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eth_phy_stats()
1022 if (ds->ops->get_eth_phy_stats) in dsa_slave_get_eth_phy_stats()
1023 ds->ops->get_eth_phy_stats(ds, dp->index, phy_stats); in dsa_slave_get_eth_phy_stats()
1030 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eth_mac_stats()
1032 if (ds->ops->get_eth_mac_stats) in dsa_slave_get_eth_mac_stats()
1033 ds->ops->get_eth_mac_stats(ds, dp->index, mac_stats); in dsa_slave_get_eth_mac_stats()
1041 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eth_ctrl_stats()
1043 if (ds->ops->get_eth_ctrl_stats) in dsa_slave_get_eth_ctrl_stats()
1044 ds->ops->get_eth_ctrl_stats(ds, dp->index, ctrl_stats); in dsa_slave_get_eth_ctrl_stats()
1053 struct dsa_switch *ds = dp->ds; in dsa_slave_get_rmon_stats()
1055 if (ds->ops->get_rmon_stats) in dsa_slave_get_rmon_stats()
1056 ds->ops->get_rmon_stats(ds, dp->index, rmon_stats, ranges); in dsa_slave_get_rmon_stats()
1063 struct dsa_switch *ds = dp->ds; in dsa_slave_net_selftest()
1065 if (ds->ops->self_test) { in dsa_slave_net_selftest()
1066 ds->ops->self_test(ds, dp->index, etest, buf); in dsa_slave_net_selftest()
1076 struct dsa_switch *ds = dp->ds; in dsa_slave_get_wol()
1078 phylink_ethtool_get_wol(dp->pl, w); in dsa_slave_get_wol()
1080 if (ds->ops->get_wol) in dsa_slave_get_wol()
1081 ds->ops->get_wol(ds, dp->index, w); in dsa_slave_get_wol()
1087 struct dsa_switch *ds = dp->ds; in dsa_slave_set_wol()
1088 int ret = -EOPNOTSUPP; in dsa_slave_set_wol()
1090 phylink_ethtool_set_wol(dp->pl, w); in dsa_slave_set_wol()
1092 if (ds->ops->set_wol) in dsa_slave_set_wol()
1093 ret = ds->ops->set_wol(ds, dp->index, w); in dsa_slave_set_wol()
1101 struct dsa_switch *ds = dp->ds; in dsa_slave_set_eee()
1105 if (!dev->phydev || !dp->pl) in dsa_slave_set_eee()
1106 return -ENODEV; in dsa_slave_set_eee()
1108 if (!ds->ops->set_mac_eee) in dsa_slave_set_eee()
1109 return -EOPNOTSUPP; in dsa_slave_set_eee()
1111 ret = ds->ops->set_mac_eee(ds, dp->index, e); in dsa_slave_set_eee()
1115 return phylink_ethtool_set_eee(dp->pl, e); in dsa_slave_set_eee()
1121 struct dsa_switch *ds = dp->ds; in dsa_slave_get_eee()
1125 if (!dev->phydev || !dp->pl) in dsa_slave_get_eee()
1126 return -ENODEV; in dsa_slave_get_eee()
1128 if (!ds->ops->get_mac_eee) in dsa_slave_get_eee()
1129 return -EOPNOTSUPP; in dsa_slave_get_eee()
1131 ret = ds->ops->get_mac_eee(ds, dp->index, e); in dsa_slave_get_eee()
1135 return phylink_ethtool_get_eee(dp->pl, e); in dsa_slave_get_eee()
1143 return phylink_ethtool_ksettings_get(dp->pl, cmd); in dsa_slave_get_link_ksettings()
1151 return phylink_ethtool_ksettings_set(dp->pl, cmd); in dsa_slave_set_link_ksettings()
1158 struct dsa_switch *ds = dp->ds; in dsa_slave_get_pause_stats()
1160 if (ds->ops->get_pause_stats) in dsa_slave_get_pause_stats()
1161 ds->ops->get_pause_stats(ds, dp->index, pause_stats); in dsa_slave_get_pause_stats()
1169 phylink_ethtool_get_pauseparam(dp->pl, pause); in dsa_slave_get_pauseparam()
1177 return phylink_ethtool_set_pauseparam(dp->pl, pause); in dsa_slave_set_pauseparam()
1191 return -ENOMEM; in dsa_slave_netpoll_setup()
1199 p->netpoll = netpoll; in dsa_slave_netpoll_setup()
1207 struct netpoll *netpoll = p->netpoll; in dsa_slave_netpoll_cleanup()
1212 p->netpoll = NULL; in dsa_slave_netpoll_cleanup()
1228 list_for_each_entry(mall_tc_entry, &p->mall_tc_list, list) in dsa_slave_mall_tc_entry_find()
1229 if (mall_tc_entry->cookie == cookie) in dsa_slave_mall_tc_entry_find()
1240 struct netlink_ext_ack *extack = cls->common.extack; in dsa_slave_add_cls_matchall_mirred()
1245 struct dsa_switch *ds = dp->ds; in dsa_slave_add_cls_matchall_mirred()
1250 if (!ds->ops->port_mirror_add) in dsa_slave_add_cls_matchall_mirred()
1251 return -EOPNOTSUPP; in dsa_slave_add_cls_matchall_mirred()
1253 if (!flow_action_basic_hw_stats_check(&cls->rule->action, in dsa_slave_add_cls_matchall_mirred()
1254 cls->common.extack)) in dsa_slave_add_cls_matchall_mirred()
1255 return -EOPNOTSUPP; in dsa_slave_add_cls_matchall_mirred()
1257 act = &cls->rule->action.entries[0]; in dsa_slave_add_cls_matchall_mirred()
1259 if (!act->dev) in dsa_slave_add_cls_matchall_mirred()
1260 return -EINVAL; in dsa_slave_add_cls_matchall_mirred()
1262 if (!dsa_slave_dev_check(act->dev)) in dsa_slave_add_cls_matchall_mirred()
1263 return -EOPNOTSUPP; in dsa_slave_add_cls_matchall_mirred()
1267 return -ENOMEM; in dsa_slave_add_cls_matchall_mirred()
1269 mall_tc_entry->cookie = cls->cookie; in dsa_slave_add_cls_matchall_mirred()
1270 mall_tc_entry->type = DSA_PORT_MALL_MIRROR; in dsa_slave_add_cls_matchall_mirred()
1271 mirror = &mall_tc_entry->mirror; in dsa_slave_add_cls_matchall_mirred()
1273 to_dp = dsa_slave_to_port(act->dev); in dsa_slave_add_cls_matchall_mirred()
1275 mirror->to_local_port = to_dp->index; in dsa_slave_add_cls_matchall_mirred()
1276 mirror->ingress = ingress; in dsa_slave_add_cls_matchall_mirred()
1278 err = ds->ops->port_mirror_add(ds, dp->index, mirror, ingress, extack); in dsa_slave_add_cls_matchall_mirred()
1284 list_add_tail(&mall_tc_entry->list, &p->mall_tc_list); in dsa_slave_add_cls_matchall_mirred()
1294 struct netlink_ext_ack *extack = cls->common.extack; in dsa_slave_add_cls_matchall_police()
1299 struct dsa_switch *ds = dp->ds; in dsa_slave_add_cls_matchall_police()
1303 if (!ds->ops->port_policer_add) { in dsa_slave_add_cls_matchall_police()
1306 return -EOPNOTSUPP; in dsa_slave_add_cls_matchall_police()
1312 return -EOPNOTSUPP; in dsa_slave_add_cls_matchall_police()
1315 if (!flow_action_basic_hw_stats_check(&cls->rule->action, in dsa_slave_add_cls_matchall_police()
1316 cls->common.extack)) in dsa_slave_add_cls_matchall_police()
1317 return -EOPNOTSUPP; in dsa_slave_add_cls_matchall_police()
1319 list_for_each_entry(mall_tc_entry, &p->mall_tc_list, list) { in dsa_slave_add_cls_matchall_police()
1320 if (mall_tc_entry->type == DSA_PORT_MALL_POLICER) { in dsa_slave_add_cls_matchall_police()
1323 return -EEXIST; in dsa_slave_add_cls_matchall_police()
1327 act = &cls->rule->action.entries[0]; in dsa_slave_add_cls_matchall_police()
1331 return -ENOMEM; in dsa_slave_add_cls_matchall_police()
1333 mall_tc_entry->cookie = cls->cookie; in dsa_slave_add_cls_matchall_police()
1334 mall_tc_entry->type = DSA_PORT_MALL_POLICER; in dsa_slave_add_cls_matchall_police()
1335 policer = &mall_tc_entry->policer; in dsa_slave_add_cls_matchall_police()
1336 policer->rate_bytes_per_sec = act->police.rate_bytes_ps; in dsa_slave_add_cls_matchall_police()
1337 policer->burst = act->police.burst; in dsa_slave_add_cls_matchall_police()
1339 err = ds->ops->port_policer_add(ds, dp->index, policer); in dsa_slave_add_cls_matchall_police()
1345 list_add_tail(&mall_tc_entry->list, &p->mall_tc_list); in dsa_slave_add_cls_matchall_police()
1354 int err = -EOPNOTSUPP; in dsa_slave_add_cls_matchall()
1356 if (cls->common.protocol == htons(ETH_P_ALL) && in dsa_slave_add_cls_matchall()
1357 flow_offload_has_one_action(&cls->rule->action) && in dsa_slave_add_cls_matchall()
1358 cls->rule->action.entries[0].id == FLOW_ACTION_MIRRED) in dsa_slave_add_cls_matchall()
1360 else if (flow_offload_has_one_action(&cls->rule->action) && in dsa_slave_add_cls_matchall()
1361 cls->rule->action.entries[0].id == FLOW_ACTION_POLICE) in dsa_slave_add_cls_matchall()
1372 struct dsa_switch *ds = dp->ds; in dsa_slave_del_cls_matchall()
1374 mall_tc_entry = dsa_slave_mall_tc_entry_find(dev, cls->cookie); in dsa_slave_del_cls_matchall()
1378 list_del(&mall_tc_entry->list); in dsa_slave_del_cls_matchall()
1380 switch (mall_tc_entry->type) { in dsa_slave_del_cls_matchall()
1381 case DSA_PORT_MALL_MIRROR: in dsa_slave_del_cls_matchall()
1382 if (ds->ops->port_mirror_del) in dsa_slave_del_cls_matchall()
1383 ds->ops->port_mirror_del(ds, dp->index, in dsa_slave_del_cls_matchall()
1384 &mall_tc_entry->mirror); in dsa_slave_del_cls_matchall()
1386 case DSA_PORT_MALL_POLICER: in dsa_slave_del_cls_matchall()
1387 if (ds->ops->port_policer_del) in dsa_slave_del_cls_matchall()
1388 ds->ops->port_policer_del(ds, dp->index); in dsa_slave_del_cls_matchall()
1401 if (cls->common.chain_index) in dsa_slave_setup_tc_cls_matchall()
1402 return -EOPNOTSUPP; in dsa_slave_setup_tc_cls_matchall()
1404 switch (cls->command) { in dsa_slave_setup_tc_cls_matchall()
1405 case TC_CLSMATCHALL_REPLACE: in dsa_slave_setup_tc_cls_matchall()
1407 case TC_CLSMATCHALL_DESTROY: in dsa_slave_setup_tc_cls_matchall()
1411 return -EOPNOTSUPP; in dsa_slave_setup_tc_cls_matchall()
1420 struct dsa_switch *ds = dp->ds; in dsa_slave_add_cls_flower()
1421 int port = dp->index; in dsa_slave_add_cls_flower()
1423 if (!ds->ops->cls_flower_add) in dsa_slave_add_cls_flower()
1424 return -EOPNOTSUPP; in dsa_slave_add_cls_flower()
1426 return ds->ops->cls_flower_add(ds, port, cls, ingress); in dsa_slave_add_cls_flower()
1434 struct dsa_switch *ds = dp->ds; in dsa_slave_del_cls_flower()
1435 int port = dp->index; in dsa_slave_del_cls_flower()
1437 if (!ds->ops->cls_flower_del) in dsa_slave_del_cls_flower()
1438 return -EOPNOTSUPP; in dsa_slave_del_cls_flower()
1440 return ds->ops->cls_flower_del(ds, port, cls, ingress); in dsa_slave_del_cls_flower()
1448 struct dsa_switch *ds = dp->ds; in dsa_slave_stats_cls_flower()
1449 int port = dp->index; in dsa_slave_stats_cls_flower()
1451 if (!ds->ops->cls_flower_stats) in dsa_slave_stats_cls_flower()
1452 return -EOPNOTSUPP; in dsa_slave_stats_cls_flower()
1454 return ds->ops->cls_flower_stats(ds, port, cls, ingress); in dsa_slave_stats_cls_flower()
1461 switch (cls->command) { in dsa_slave_setup_tc_cls_flower()
1462 case FLOW_CLS_REPLACE: in dsa_slave_setup_tc_cls_flower()
1464 case FLOW_CLS_DESTROY: in dsa_slave_setup_tc_cls_flower()
1466 case FLOW_CLS_STATS: in dsa_slave_setup_tc_cls_flower()
1469 return -EOPNOTSUPP; in dsa_slave_setup_tc_cls_flower()
1479 return -EOPNOTSUPP; in dsa_slave_setup_tc_block_cb()
1482 case TC_SETUP_CLSMATCHALL: in dsa_slave_setup_tc_block_cb()
1484 case TC_SETUP_CLSFLOWER: in dsa_slave_setup_tc_block_cb()
1487 return -EOPNOTSUPP; in dsa_slave_setup_tc_block_cb()
1511 if (f->binder_type == FLOW_BLOCK_BINDER_TYPE_CLSACT_INGRESS) in dsa_slave_setup_tc_block()
1513 else if (f->binder_type == FLOW_BLOCK_BINDER_TYPE_CLSACT_EGRESS) in dsa_slave_setup_tc_block()
1516 return -EOPNOTSUPP; in dsa_slave_setup_tc_block()
1518 f->driver_block_list = &dsa_slave_block_cb_list; in dsa_slave_setup_tc_block()
1520 switch (f->command) { in dsa_slave_setup_tc_block()
1521 case FLOW_BLOCK_BIND: in dsa_slave_setup_tc_block()
1523 return -EBUSY; in dsa_slave_setup_tc_block()
1530 list_add_tail(&block_cb->driver_list, &dsa_slave_block_cb_list); in dsa_slave_setup_tc_block()
1532 case FLOW_BLOCK_UNBIND: in dsa_slave_setup_tc_block()
1533 block_cb = flow_block_cb_lookup(f->block, cb, dev); in dsa_slave_setup_tc_block()
1535 return -ENOENT; in dsa_slave_setup_tc_block()
1538 list_del(&block_cb->driver_list); in dsa_slave_setup_tc_block()
1541 return -EOPNOTSUPP; in dsa_slave_setup_tc_block()
1550 if (!master->netdev_ops->ndo_setup_tc) in dsa_slave_setup_ft_block()
1551 return -EOPNOTSUPP; in dsa_slave_setup_ft_block()
1553 return master->netdev_ops->ndo_setup_tc(master, TC_SETUP_FT, type_data); in dsa_slave_setup_ft_block()
1560 struct dsa_switch *ds = dp->ds; in dsa_slave_setup_tc()
1563 case TC_SETUP_BLOCK: in dsa_slave_setup_tc()
1565 case TC_SETUP_FT: in dsa_slave_setup_tc()
1566 return dsa_slave_setup_ft_block(ds, dp->index, type_data); in dsa_slave_setup_tc()
1571 if (!ds->ops->port_setup_tc) in dsa_slave_setup_tc()
1572 return -EOPNOTSUPP; in dsa_slave_setup_tc()
1574 return ds->ops->port_setup_tc(ds, dp->index, type, type_data); in dsa_slave_setup_tc()
1581 struct dsa_switch *ds = dp->ds; in dsa_slave_get_rxnfc()
1583 if (!ds->ops->get_rxnfc) in dsa_slave_get_rxnfc()
1584 return -EOPNOTSUPP; in dsa_slave_get_rxnfc()
1586 return ds->ops->get_rxnfc(ds, dp->index, nfc, rule_locs); in dsa_slave_get_rxnfc()
1593 struct dsa_switch *ds = dp->ds; in dsa_slave_set_rxnfc()
1595 if (!ds->ops->set_rxnfc) in dsa_slave_set_rxnfc()
1596 return -EOPNOTSUPP; in dsa_slave_set_rxnfc()
1598 return ds->ops->set_rxnfc(ds, dp->index, nfc); in dsa_slave_set_rxnfc()
1605 struct dsa_switch *ds = p->dp->ds; in dsa_slave_get_ts_info()
1607 if (!ds->ops->get_ts_info) in dsa_slave_get_ts_info()
1608 return -EOPNOTSUPP; in dsa_slave_get_ts_info()
1610 return ds->ops->get_ts_info(ds, p->dp->index, ts); in dsa_slave_get_ts_info()
1620 /* This API only allows programming tagged, non-PVID VIDs */ in dsa_slave_vlan_rx_add_vid()
1638 netdev_err(dev, "CPU port %d: %s\n", dp->cpu_dp->index, in dsa_slave_vlan_rx_add_vid()
1652 /* This API only allows programming tagged, non-PVID VIDs */ in dsa_slave_vlan_rx_kill_vid()
1680 * VLAN-aware bridge are VLAN-aware, and standalone ports are VLAN-unaware,
1683 * If ds->vlan_filtering_is_global = true, then standalone ports which share
1684 * the same switch with other ports that offload a VLAN-aware bridge are also
1685 * inevitably VLAN-aware.
1689 * - If standalone (this includes software bridge, software LAG):
1690 * - if ds->needs_standalone_vlan_filtering = true, OR if
1691 * (ds->vlan_filtering_is_global = true AND there are bridges spanning
1693 * - the 8021q upper VLANs
1694 * - else (standalone VLAN filtering is not needed, VLAN filtering is not
1695 * global, or it is, but no port is under a VLAN-aware bridge):
1696 * - no VLAN (any 8021q upper is a software VLAN)
1698 * - If under a vlan_filtering=0 bridge which it offload:
1699 * - if ds->configure_vlan_while_not_filtering = true (default):
1700 * - the bridge VLANs. These VLANs are committed to hardware but inactive.
1701 * - else (deprecated):
1702 * - no VLAN. The bridge VLANs are not restored when VLAN awareness is
1705 * - If under a vlan_filtering=1 bridge which it offload:
1706 * - the bridge VLANs
1707 * - the 8021q upper VLANs
1715 slave->features |= NETIF_F_HW_VLAN_CTAG_FILTER; in dsa_slave_manage_vlan_filtering()
1720 slave->features &= ~NETIF_F_HW_VLAN_CTAG_FILTER; in dsa_slave_manage_vlan_filtering()
1728 slave->features &= ~NETIF_F_HW_VLAN_CTAG_FILTER; in dsa_slave_manage_vlan_filtering()
1746 if (p->dev->mtu == mtu) in dsa_hw_port_list_set_mtu()
1749 err = dev_set_mtu(p->dev, mtu); in dsa_hw_port_list_set_mtu()
1758 if (p->dev->mtu == p->old_mtu) in dsa_hw_port_list_set_mtu()
1761 if (dev_set_mtu(p->dev, p->old_mtu)) in dsa_hw_port_list_set_mtu()
1762 netdev_err(p->dev, "Failed to restore MTU\n"); in dsa_hw_port_list_set_mtu()
1785 if (!dp->ds->mtu_enforcement_ingress) in dsa_bridge_mtu_normalization()
1788 if (!dp->bridge) in dsa_bridge_mtu_normalization()
1797 list_for_each_entry(other_dp, &dst->ports, list) { in dsa_bridge_mtu_normalization()
1801 if (other_dp->type != DSA_PORT_TYPE_USER) in dsa_bridge_mtu_normalization()
1807 if (!other_dp->ds->mtu_enforcement_ingress) in dsa_bridge_mtu_normalization()
1810 slave = other_dp->slave; in dsa_bridge_mtu_normalization()
1812 if (min_mtu > slave->mtu) in dsa_bridge_mtu_normalization()
1813 min_mtu = slave->mtu; in dsa_bridge_mtu_normalization()
1819 hw_port->dev = slave; in dsa_bridge_mtu_normalization()
1820 hw_port->old_mtu = slave->mtu; in dsa_bridge_mtu_normalization()
1822 list_add(&hw_port->list, &hw_port_list); in dsa_bridge_mtu_normalization()
1828 * user was to raise or lower it. in dsa_bridge_mtu_normalization()
1830 err = dsa_hw_port_list_set_mtu(&hw_port_list, dp->slave->mtu); in dsa_bridge_mtu_normalization()
1848 struct dsa_port *cpu_dp = dp->cpu_dp; in dsa_slave_change_mtu()
1849 struct dsa_switch *ds = dp->ds; in dsa_slave_change_mtu()
1858 if (!ds->ops->port_change_mtu) in dsa_slave_change_mtu()
1859 return -EOPNOTSUPP; in dsa_slave_change_mtu()
1861 dsa_tree_for_each_user_port(other_dp, ds->dst) { in dsa_slave_change_mtu()
1868 if (!other_dp->slave) in dsa_slave_change_mtu()
1877 slave_mtu = other_dp->slave->mtu; in dsa_slave_change_mtu()
1883 mtu_limit = min_t(int, master->max_mtu, dev->max_mtu); in dsa_slave_change_mtu()
1884 old_master_mtu = master->mtu; in dsa_slave_change_mtu()
1885 new_master_mtu = largest_mtu + dsa_tag_protocol_overhead(cpu_dp->tag_ops); in dsa_slave_change_mtu()
1887 return -ERANGE; in dsa_slave_change_mtu()
1908 err = ds->ops->port_change_mtu(ds, dp->index, new_mtu); in dsa_slave_change_mtu()
1912 dev->mtu = new_mtu; in dsa_slave_change_mtu()
1920 dsa_port_mtu_change(cpu_dp, old_master_mtu - in dsa_slave_change_mtu()
1921 dsa_tag_protocol_overhead(cpu_dp->tag_ops)); in dsa_slave_change_mtu()
1933 struct dsa_switch *ds = dp->ds; in dsa_slave_dcbnl_set_default_prio()
1935 int err, port = dp->index; in dsa_slave_dcbnl_set_default_prio()
1937 if (!ds->ops->port_set_default_prio) in dsa_slave_dcbnl_set_default_prio()
1938 return -EOPNOTSUPP; in dsa_slave_dcbnl_set_default_prio()
1947 err = ds->ops->port_set_default_prio(ds, port, new_prio); in dsa_slave_dcbnl_set_default_prio()
1960 struct dsa_switch *ds = dp->ds; in dsa_slave_dcbnl_add_dscp_prio()
1962 int err, port = dp->index; in dsa_slave_dcbnl_add_dscp_prio()
1963 u8 dscp = app->protocol; in dsa_slave_dcbnl_add_dscp_prio()
1965 if (!ds->ops->port_add_dscp_prio) in dsa_slave_dcbnl_add_dscp_prio()
1966 return -EOPNOTSUPP; in dsa_slave_dcbnl_add_dscp_prio()
1971 return -EINVAL; in dsa_slave_dcbnl_add_dscp_prio()
1981 err = ds->ops->port_add_dscp_prio(ds, port, dscp, new_prio); in dsa_slave_dcbnl_add_dscp_prio()
1993 switch (app->selector) { in dsa_slave_dcbnl_ieee_setapp()
1994 case IEEE_8021QAZ_APP_SEL_ETHERTYPE: in dsa_slave_dcbnl_ieee_setapp()
1995 switch (app->protocol) { in dsa_slave_dcbnl_ieee_setapp()
1996 case 0: in dsa_slave_dcbnl_ieee_setapp()
1999 return -EOPNOTSUPP; in dsa_slave_dcbnl_ieee_setapp()
2002 case IEEE_8021QAZ_APP_SEL_DSCP: in dsa_slave_dcbnl_ieee_setapp()
2005 return -EOPNOTSUPP; in dsa_slave_dcbnl_ieee_setapp()
2013 struct dsa_switch *ds = dp->ds; in dsa_slave_dcbnl_del_default_prio()
2015 int err, port = dp->index; in dsa_slave_dcbnl_del_default_prio()
2017 if (!ds->ops->port_set_default_prio) in dsa_slave_dcbnl_del_default_prio()
2018 return -EOPNOTSUPP; in dsa_slave_dcbnl_del_default_prio()
2027 err = ds->ops->port_set_default_prio(ds, port, new_prio); in dsa_slave_dcbnl_del_default_prio()
2040 struct dsa_switch *ds = dp->ds; in dsa_slave_dcbnl_del_dscp_prio()
2041 int err, port = dp->index; in dsa_slave_dcbnl_del_dscp_prio()
2042 u8 dscp = app->protocol; in dsa_slave_dcbnl_del_dscp_prio()
2044 if (!ds->ops->port_del_dscp_prio) in dsa_slave_dcbnl_del_dscp_prio()
2045 return -EOPNOTSUPP; in dsa_slave_dcbnl_del_dscp_prio()
2051 err = ds->ops->port_del_dscp_prio(ds, port, dscp, app->priority); in dsa_slave_dcbnl_del_dscp_prio()
2063 switch (app->selector) { in dsa_slave_dcbnl_ieee_delapp()
2064 case IEEE_8021QAZ_APP_SEL_ETHERTYPE: in dsa_slave_dcbnl_ieee_delapp()
2065 switch (app->protocol) { in dsa_slave_dcbnl_ieee_delapp()
2066 case 0: in dsa_slave_dcbnl_ieee_delapp()
2069 return -EOPNOTSUPP; in dsa_slave_dcbnl_ieee_delapp()
2072 case IEEE_8021QAZ_APP_SEL_DSCP: in dsa_slave_dcbnl_ieee_delapp()
2075 return -EOPNOTSUPP; in dsa_slave_dcbnl_ieee_delapp()
2079 /* Pre-populate the DCB application priority table with the priorities
2085 struct dsa_switch *ds = dp->ds; in dsa_slave_dcbnl_init()
2086 int port = dp->index; in dsa_slave_dcbnl_init()
2089 if (ds->ops->port_get_default_prio) { in dsa_slave_dcbnl_init()
2090 int prio = ds->ops->port_get_default_prio(ds, port); in dsa_slave_dcbnl_init()
2105 if (ds->ops->port_get_dscp_prio) { in dsa_slave_dcbnl_init()
2115 prio = ds->ops->port_get_dscp_prio(ds, port, protocol); in dsa_slave_dcbnl_init()
2116 if (prio == -EOPNOTSUPP) in dsa_slave_dcbnl_init()
2172 return &dp->devlink_port; in dsa_slave_get_devlink_port()
2179 struct dsa_switch *ds = dp->ds; in dsa_slave_get_stats64()
2181 if (ds->ops->get_stats64) in dsa_slave_get_stats64()
2182 ds->ops->get_stats64(ds, dp->index, s); in dsa_slave_get_stats64()
2190 struct dsa_port *dp = dsa_slave_to_port(ctx->dev); in dsa_slave_fill_forward_path()
2192 struct dsa_port *cpu_dp = dp->cpu_dp; in dsa_slave_fill_forward_path()
2194 path->dev = ctx->dev; in dsa_slave_fill_forward_path()
2195 path->type = DEV_PATH_DSA; in dsa_slave_fill_forward_path()
2196 path->dsa.proto = cpu_dp->tag_ops->proto; in dsa_slave_fill_forward_path()
2197 path->dsa.port = dp->index; in dsa_slave_fill_forward_path()
2198 ctx->dev = master; in dsa_slave_fill_forward_path()
2235 if (dp->pl) in dsa_port_phylink_mac_change()
2236 phylink_mac_change(dp->pl, up); in dsa_port_phylink_mac_change()
2244 struct dsa_switch *ds = dp->ds; in dsa_slave_phylink_fixed_state()
2249 ds->ops->phylink_fixed_state(ds, dp->index, state); in dsa_slave_phylink_fixed_state()
2257 struct dsa_switch *ds = dp->ds; in dsa_slave_phy_connect()
2259 slave_dev->phydev = mdiobus_get_phy(ds->slave_mii_bus, addr); in dsa_slave_phy_connect()
2260 if (!slave_dev->phydev) { in dsa_slave_phy_connect()
2262 return -ENODEV; in dsa_slave_phy_connect()
2265 slave_dev->phydev->dev_flags |= flags; in dsa_slave_phy_connect()
2267 return phylink_connect_phy(dp->pl, slave_dev->phydev); in dsa_slave_phy_connect()
2273 struct device_node *port_dn = dp->dn; in dsa_slave_phy_setup()
2274 struct dsa_switch *ds = dp->ds; in dsa_slave_phy_setup()
2278 dp->pl_config.dev = &slave_dev->dev; in dsa_slave_phy_setup()
2279 dp->pl_config.type = PHYLINK_NETDEV; in dsa_slave_phy_setup()
2285 if (ds->ops->phylink_fixed_state) { in dsa_slave_phy_setup()
2286 dp->pl_config.get_fixed_state = dsa_slave_phylink_fixed_state; in dsa_slave_phy_setup()
2287 dp->pl_config.poll_fixed_state = true; in dsa_slave_phy_setup()
2294 if (ds->ops->get_phy_flags) in dsa_slave_phy_setup()
2295 phy_flags = ds->ops->get_phy_flags(ds, dp->index); in dsa_slave_phy_setup()
2297 ret = phylink_of_phy_connect(dp->pl, port_dn, phy_flags); in dsa_slave_phy_setup()
2298 if (ret == -ENODEV && ds->slave_mii_bus) { in dsa_slave_phy_setup()
2302 ret = dsa_slave_phy_connect(slave_dev, dp->index, phy_flags); in dsa_slave_phy_setup()
2318 const struct dsa_port *cpu_dp = dp->cpu_dp; in dsa_slave_setup_tagger()
2319 const struct dsa_switch *ds = dp->ds; in dsa_slave_setup_tagger()
2321 slave->needed_headroom = cpu_dp->tag_ops->needed_headroom; in dsa_slave_setup_tagger()
2322 slave->needed_tailroom = cpu_dp->tag_ops->needed_tailroom; in dsa_slave_setup_tagger()
2327 slave->needed_headroom += master->needed_headroom; in dsa_slave_setup_tagger()
2328 slave->needed_tailroom += master->needed_tailroom; in dsa_slave_setup_tagger()
2330 p->xmit = cpu_dp->tag_ops->xmit; in dsa_slave_setup_tagger()
2332 slave->features = master->vlan_features | NETIF_F_HW_TC; in dsa_slave_setup_tagger()
2333 slave->hw_features |= NETIF_F_HW_TC; in dsa_slave_setup_tagger()
2334 slave->features |= NETIF_F_LLTX; in dsa_slave_setup_tagger()
2335 if (slave->needed_tailroom) in dsa_slave_setup_tagger()
2336 slave->features &= ~(NETIF_F_SG | NETIF_F_FRAGLIST); in dsa_slave_setup_tagger()
2337 if (ds->needs_standalone_vlan_filtering) in dsa_slave_setup_tagger()
2338 slave->features |= NETIF_F_HW_VLAN_CTAG_FILTER; in dsa_slave_setup_tagger()
2351 phylink_stop(dp->pl); in dsa_slave_suspend()
2367 phylink_start(dp->pl); in dsa_slave_resume()
2376 struct dsa_switch *ds = port->ds; in dsa_slave_create()
2377 const char *name = port->name; in dsa_slave_create()
2382 if (!ds->num_tx_queues) in dsa_slave_create()
2383 ds->num_tx_queues = 1; in dsa_slave_create()
2387 ds->num_tx_queues, 1); in dsa_slave_create()
2389 return -ENOMEM; in dsa_slave_create()
2391 slave_dev->rtnl_link_ops = &dsa_link_ops; in dsa_slave_create()
2392 slave_dev->ethtool_ops = &dsa_slave_ethtool_ops; in dsa_slave_create()
2394 slave_dev->dcbnl_ops = &dsa_slave_dcbnl_ops; in dsa_slave_create()
2396 if (!is_zero_ether_addr(port->mac)) in dsa_slave_create()
2397 eth_hw_addr_set(slave_dev, port->mac); in dsa_slave_create()
2400 slave_dev->priv_flags |= IFF_NO_QUEUE; in dsa_slave_create()
2402 slave_dev->priv_flags |= IFF_UNICAST_FLT; in dsa_slave_create()
2403 slave_dev->netdev_ops = &dsa_slave_netdev_ops; in dsa_slave_create()
2404 if (ds->ops->port_max_mtu) in dsa_slave_create()
2405 slave_dev->max_mtu = ds->ops->port_max_mtu(ds, port->index); in dsa_slave_create()
2408 SET_NETDEV_DEV(slave_dev, port->ds->dev); in dsa_slave_create()
2409 slave_dev->dev.of_node = port->dn; in dsa_slave_create()
2410 slave_dev->vlan_features = master->vlan_features; in dsa_slave_create()
2413 slave_dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); in dsa_slave_create()
2414 if (!slave_dev->tstats) { in dsa_slave_create()
2416 return -ENOMEM; in dsa_slave_create()
2419 ret = gro_cells_init(&p->gcells, slave_dev); in dsa_slave_create()
2423 p->dp = port; in dsa_slave_create()
2424 INIT_LIST_HEAD(&p->mall_tc_list); in dsa_slave_create()
2425 port->slave = slave_dev; in dsa_slave_create()
2434 ret, ds->dst->index, ds->index, port->index); in dsa_slave_create()
2441 if (ret && ret != -EOPNOTSUPP) in dsa_slave_create()
2442 dev_warn(ds->dev, "nonfatal error %d setting MTU to %d on port %d\n", in dsa_slave_create()
2443 ret, ETH_DATA_LEN, port->index); in dsa_slave_create()
2448 ret, slave_dev->name); in dsa_slave_create()
2477 phylink_disconnect_phy(p->dp->pl); in dsa_slave_create()
2479 dsa_port_phylink_destroy(p->dp); in dsa_slave_create()
2481 gro_cells_destroy(&p->gcells); in dsa_slave_create()
2483 free_percpu(slave_dev->tstats); in dsa_slave_create()
2485 port->slave = NULL; in dsa_slave_create()
2499 phylink_disconnect_phy(dp->pl); in dsa_slave_destroy()
2503 gro_cells_destroy(&p->gcells); in dsa_slave_destroy()
2504 free_percpu(slave_dev->tstats); in dsa_slave_destroy()
2513 struct dsa_switch *ds = dp->ds; in dsa_slave_change_master()
2521 if (!ds->ops->port_change_master) { in dsa_slave_change_master()
2524 return -EOPNOTSUPP; in dsa_slave_change_master()
2530 return -EOPNOTSUPP; in dsa_slave_change_master()
2539 return -EOPNOTSUPP; in dsa_slave_change_master()
2542 /* Since we allow live-changing the DSA master, plus we auto-open the in dsa_slave_change_master()
2546 if (dev->flags & IFF_UP) { in dsa_slave_change_master()
2562 /* Update the MTU of the new CPU port through cross-chip notifiers */ in dsa_slave_change_master()
2563 err = dsa_slave_change_mtu(dev, dev->mtu); in dsa_slave_change_master()
2564 if (err && err != -EOPNOTSUPP) { in dsa_slave_change_master()
2573 if (is_zero_ether_addr(dp->mac)) in dsa_slave_change_master()
2587 return dev->netdev_ops == &dsa_slave_netdev_ops; in dsa_slave_dev_check()
2601 extack = netdev_notifier_info_to_extack(&info->info); in dsa_slave_changeupper()
2603 if (netif_is_bridge_master(info->upper_dev)) { in dsa_slave_changeupper()
2604 if (info->linking) { in dsa_slave_changeupper()
2605 err = dsa_port_bridge_join(dp, info->upper_dev, extack); in dsa_slave_changeupper()
2608 if (err == -EOPNOTSUPP) { in dsa_slave_changeupper()
2609 if (extack && !extack->_msg) in dsa_slave_changeupper()
2616 dsa_port_bridge_leave(dp, info->upper_dev); in dsa_slave_changeupper()
2619 } else if (netif_is_lag_master(info->upper_dev)) { in dsa_slave_changeupper()
2620 if (info->linking) { in dsa_slave_changeupper()
2621 err = dsa_port_lag_join(dp, info->upper_dev, in dsa_slave_changeupper()
2622 info->upper_info, extack); in dsa_slave_changeupper()
2623 if (err == -EOPNOTSUPP) { in dsa_slave_changeupper()
2624 NL_SET_ERR_MSG_MOD(info->info.extack, in dsa_slave_changeupper()
2630 dsa_port_lag_leave(dp, info->upper_dev); in dsa_slave_changeupper()
2633 } else if (is_hsr_master(info->upper_dev)) { in dsa_slave_changeupper()
2634 if (info->linking) { in dsa_slave_changeupper()
2635 err = dsa_port_hsr_join(dp, info->upper_dev); in dsa_slave_changeupper()
2636 if (err == -EOPNOTSUPP) { in dsa_slave_changeupper()
2637 NL_SET_ERR_MSG_MOD(info->info.extack, in dsa_slave_changeupper()
2643 dsa_port_hsr_leave(dp, info->upper_dev); in dsa_slave_changeupper()
2659 if (netif_is_bridge_master(info->upper_dev) && !info->linking) in dsa_slave_prechangeupper()
2660 dsa_port_pre_bridge_leave(dp, info->upper_dev); in dsa_slave_prechangeupper()
2661 else if (netif_is_lag_master(info->upper_dev) && !info->linking) in dsa_slave_prechangeupper()
2662 dsa_port_pre_lag_leave(dp, info->upper_dev); in dsa_slave_prechangeupper()
2674 struct net_device *lower; in dsa_slave_lag_changeupper() local
2682 netdev_for_each_lower_dev(dev, lower, iter) { in dsa_slave_lag_changeupper()
2683 if (!dsa_slave_dev_check(lower)) in dsa_slave_lag_changeupper()
2686 dp = dsa_slave_to_port(lower); in dsa_slave_lag_changeupper()
2687 if (!dp->lag) in dsa_slave_lag_changeupper()
2691 err = dsa_slave_changeupper(lower, info); in dsa_slave_lag_changeupper()
2706 struct net_device *lower; in dsa_slave_lag_prechangeupper() local
2714 netdev_for_each_lower_dev(dev, lower, iter) { in dsa_slave_lag_prechangeupper()
2715 if (!dsa_slave_dev_check(lower)) in dsa_slave_lag_prechangeupper()
2718 dp = dsa_slave_to_port(lower); in dsa_slave_lag_prechangeupper()
2719 if (!dp->lag) in dsa_slave_lag_prechangeupper()
2723 err = dsa_slave_prechangeupper(lower, info); in dsa_slave_lag_prechangeupper()
2739 ext_ack = netdev_notifier_info_to_extack(&info->info); in dsa_prevent_bridging_8021q_upper()
2753 /* Deny enslaving a VLAN device into a VLAN-aware bridge */ in dsa_prevent_bridging_8021q_upper()
2755 netif_is_bridge_master(info->upper_dev) && info->linking) { in dsa_prevent_bridging_8021q_upper()
2758 return notifier_from_errno(-EINVAL); in dsa_prevent_bridging_8021q_upper()
2778 extack = netdev_notifier_info_to_extack(&info->info); in dsa_slave_check_8021q_upper()
2779 vid = vlan_dev_vlan_id(info->upper_dev); in dsa_slave_check_8021q_upper()
2781 /* br_vlan_get_info() returns -EINVAL or -ENOENT if the in dsa_slave_check_8021q_upper()
2789 return notifier_from_errno(-EBUSY); in dsa_slave_check_8021q_upper()
2807 ds = dp->ds; in dsa_slave_prechangeupper_sanity_check()
2809 if (ds->ops->port_prechangeupper) { in dsa_slave_prechangeupper_sanity_check()
2810 err = ds->ops->port_prechangeupper(ds, dp->index, info); in dsa_slave_prechangeupper_sanity_check()
2815 if (is_vlan_dev(info->upper_dev)) in dsa_slave_prechangeupper_sanity_check()
2821 /* To be eligible as a DSA master, a LAG must have all lower interfaces be
2837 return notifier_from_errno(-EINVAL); in dsa_lag_master_validate()
2843 if (!dsa_port_tree_same(lower1->dsa_ptr, in dsa_lag_master_validate()
2844 lower2->dsa_ptr)) { in dsa_lag_master_validate()
2847 return notifier_from_errno(-EINVAL); in dsa_lag_master_validate()
2859 struct netlink_ext_ack *extack = netdev_notifier_info_to_extack(&info->info); in dsa_master_prechangeupper_sanity_check()
2864 if (!info->linking) in dsa_master_prechangeupper_sanity_check()
2868 if (dsa_slave_dev_check(info->upper_dev)) in dsa_master_prechangeupper_sanity_check()
2874 if (netif_is_bridge_master(info->upper_dev)) in dsa_master_prechangeupper_sanity_check()
2880 if (netif_is_lag_master(info->upper_dev)) in dsa_master_prechangeupper_sanity_check()
2881 return dsa_lag_master_validate(info->upper_dev, extack); in dsa_master_prechangeupper_sanity_check()
2885 return notifier_from_errno(-EBUSY); in dsa_master_prechangeupper_sanity_check()
2892 struct netlink_ext_ack *extack = netdev_notifier_info_to_extack(&info->info); in dsa_lag_master_prechangelower_sanity_check()
2893 struct net_device *lag_dev = info->upper_dev; in dsa_lag_master_prechangelower_sanity_check()
2894 struct net_device *lower; in dsa_lag_master_prechangelower_sanity_check() local
2900 if (!info->linking) in dsa_lag_master_prechangelower_sanity_check()
2906 return notifier_from_errno(-EINVAL); in dsa_lag_master_prechangelower_sanity_check()
2909 netdev_for_each_lower_dev(lag_dev, lower, iter) { in dsa_lag_master_prechangelower_sanity_check()
2910 if (!dsa_port_tree_same(dev->dsa_ptr, lower->dsa_ptr)) { in dsa_lag_master_prechangelower_sanity_check()
2913 return notifier_from_errno(-EINVAL); in dsa_lag_master_prechangelower_sanity_check()
2927 * The only case where that would not be an issue is when bridging can already
2935 struct net_device *br = info->upper_dev; in dsa_bridge_prechangelower_sanity_check()
2937 struct net_device *lower; in dsa_bridge_prechangelower_sanity_check() local
2943 if (!info->linking) in dsa_bridge_prechangelower_sanity_check()
2946 extack = netdev_notifier_info_to_extack(&info->info); in dsa_bridge_prechangelower_sanity_check()
2948 netdev_for_each_lower_dev(br, lower, iter) { in dsa_bridge_prechangelower_sanity_check()
2949 if (!netdev_uses_dsa(new_lower) && !netdev_uses_dsa(lower)) in dsa_bridge_prechangelower_sanity_check()
2952 if (!netdev_port_same_parent_id(lower, new_lower)) { in dsa_bridge_prechangelower_sanity_check()
2955 return notifier_from_errno(-EINVAL); in dsa_bridge_prechangelower_sanity_check()
2973 err = dsa_slave_change_master(dp->slave, new_master, NULL); in dsa_tree_migrate_ports_from_lag_master()
2975 netdev_err(dp->slave, in dsa_tree_migrate_ports_from_lag_master()
2977 new_master->name, ERR_PTR(err)); in dsa_tree_migrate_ports_from_lag_master()
2987 struct dsa_port *cpu_dp = master->dsa_ptr; in dsa_master_lag_join()
2988 struct dsa_switch_tree *dst = cpu_dp->dst; in dsa_master_lag_join()
3000 err = dsa_slave_change_master(dp->slave, lag_dev, extack); in dsa_master_lag_join()
3012 err = dsa_slave_change_master(dp->slave, master, NULL); in dsa_master_lag_join()
3014 netdev_err(dp->slave, in dsa_master_lag_join()
3016 master->name, ERR_PTR(err)); in dsa_master_lag_join()
3020 dsa_master_lag_teardown(lag_dev, master->dsa_ptr); in dsa_master_lag_join()
3028 struct dsa_port *dp, *cpu_dp = lag_dev->dsa_ptr; in dsa_master_lag_leave()
3029 struct dsa_switch_tree *dst = cpu_dp->dst; in dsa_master_lag_leave()
3031 struct net_device *lower; in dsa_master_lag_leave() local
3034 netdev_for_each_lower_dev(lag_dev, lower, iter) { in dsa_master_lag_leave()
3035 if (netdev_uses_dsa(lower)) { in dsa_master_lag_leave()
3036 new_cpu_dp = lower->dsa_ptr; in dsa_master_lag_leave()
3047 dp->cpu_dp = new_cpu_dp; in dsa_master_lag_leave()
3052 lag_dev->dsa_ptr = new_cpu_dp; in dsa_master_lag_leave()
3061 /* This DSA master has left its LAG in any case, so let in dsa_master_lag_leave()
3064 dsa_master_lag_teardown(lag_dev, master->dsa_ptr); in dsa_master_lag_leave()
3076 extack = netdev_notifier_info_to_extack(&info->info); in dsa_master_changeupper()
3078 if (netif_is_lag_master(info->upper_dev)) { in dsa_master_changeupper()
3079 if (info->linking) { in dsa_master_changeupper()
3080 err = dsa_master_lag_join(dev, info->upper_dev, in dsa_master_changeupper()
3081 info->upper_info, extack); in dsa_master_changeupper()
3084 dsa_master_lag_leave(dev, info->upper_dev); in dsa_master_changeupper()
3098 case NETDEV_PRECHANGEUPPER: { in dsa_slave_netdevice_event()
3128 case NETDEV_CHANGEUPPER: { in dsa_slave_netdevice_event()
3145 case NETDEV_CHANGELOWERSTATE: { in dsa_slave_netdevice_event()
3153 err = dsa_port_lag_change(dp, info->lower_state_info); in dsa_slave_netdevice_event()
3160 dp = dev->dsa_ptr; in dsa_slave_netdevice_event()
3162 err = dsa_port_lag_change(dp, info->lower_state_info); in dsa_slave_netdevice_event()
3167 case NETDEV_CHANGE: in dsa_slave_netdevice_event()
3168 case NETDEV_UP: { in dsa_slave_netdevice_event()
3174 struct dsa_port *cpu_dp = dev->dsa_ptr; in dsa_slave_netdevice_event()
3175 struct dsa_switch_tree *dst = cpu_dp->ds->dst; in dsa_slave_netdevice_event()
3197 case NETDEV_GOING_DOWN: { in dsa_slave_netdevice_event()
3205 cpu_dp = dev->dsa_ptr; in dsa_slave_netdevice_event()
3206 dst = cpu_dp->ds->dst; in dsa_slave_netdevice_event()
3210 list_for_each_entry(dp, &dst->ports, list) { in dsa_slave_netdevice_event()
3214 if (dp->cpu_dp != cpu_dp) in dsa_slave_netdevice_event()
3217 list_add(&dp->slave->close_list, &close_list); in dsa_slave_netdevice_event()
3236 info.addr = switchdev_work->addr; in dsa_fdb_offload_notify()
3237 info.vid = switchdev_work->vid; in dsa_fdb_offload_notify()
3240 switchdev_work->orig_dev, &info.info, NULL); in dsa_fdb_offload_notify()
3247 const unsigned char *addr = switchdev_work->addr; in dsa_slave_switchdev_event_work()
3248 struct net_device *dev = switchdev_work->dev; in dsa_slave_switchdev_event_work()
3249 u16 vid = switchdev_work->vid; in dsa_slave_switchdev_event_work()
3255 ds = dp->ds; in dsa_slave_switchdev_event_work()
3257 switch (switchdev_work->event) { in dsa_slave_switchdev_event_work()
3258 case SWITCHDEV_FDB_ADD_TO_DEVICE: in dsa_slave_switchdev_event_work()
3259 if (switchdev_work->host_addr) in dsa_slave_switchdev_event_work()
3261 else if (dp->lag) in dsa_slave_switchdev_event_work()
3266 dev_err(ds->dev, in dsa_slave_switchdev_event_work()
3268 dp->index, addr, vid, err); in dsa_slave_switchdev_event_work()
3274 case SWITCHDEV_FDB_DEL_TO_DEVICE: in dsa_slave_switchdev_event_work()
3275 if (switchdev_work->host_addr) in dsa_slave_switchdev_event_work()
3277 else if (dp->lag) in dsa_slave_switchdev_event_work()
3282 dev_err(ds->dev, in dsa_slave_switchdev_event_work()
3284 dp->index, addr, vid, err); in dsa_slave_switchdev_event_work()
3297 struct dsa_switch_tree *dst = dp->ds->dst; in dsa_foreign_dev_check()
3316 bool host_addr = fdb_info->is_local; in dsa_slave_fdb_event()
3317 struct dsa_switch *ds = dp->ds; in dsa_slave_fdb_event()
3322 if (!dp->bridge) in dsa_slave_fdb_event()
3333 if (!ds->assisted_learning_on_cpu_port) in dsa_slave_fdb_event()
3347 if (dp->lag && !host_addr) { in dsa_slave_fdb_event()
3348 if (!ds->ops->lag_fdb_add || !ds->ops->lag_fdb_del) in dsa_slave_fdb_event()
3349 return -EOPNOTSUPP; in dsa_slave_fdb_event()
3351 if (!ds->ops->port_fdb_add || !ds->ops->port_fdb_del) in dsa_slave_fdb_event()
3352 return -EOPNOTSUPP; in dsa_slave_fdb_event()
3357 return -ENOMEM; in dsa_slave_fdb_event()
3361 orig_dev->name, fdb_info->addr, fdb_info->vid, in dsa_slave_fdb_event()
3364 INIT_WORK(&switchdev_work->work, dsa_slave_switchdev_event_work); in dsa_slave_fdb_event()
3365 switchdev_work->event = event; in dsa_slave_fdb_event()
3366 switchdev_work->dev = dev; in dsa_slave_fdb_event()
3367 switchdev_work->orig_dev = orig_dev; in dsa_slave_fdb_event()
3369 ether_addr_copy(switchdev_work->addr, fdb_info->addr); in dsa_slave_fdb_event()
3370 switchdev_work->vid = fdb_info->vid; in dsa_slave_fdb_event()
3371 switchdev_work->host_addr = host_addr; in dsa_slave_fdb_event()
3373 dsa_schedule_work(&switchdev_work->work); in dsa_slave_fdb_event()
3386 case SWITCHDEV_PORT_ATTR_SET: in dsa_slave_switchdev_event()
3391 case SWITCHDEV_FDB_ADD_TO_DEVICE: in dsa_slave_switchdev_event()
3392 case SWITCHDEV_FDB_DEL_TO_DEVICE: in dsa_slave_switchdev_event()
3412 case SWITCHDEV_PORT_OBJ_ADD: in dsa_slave_switchdev_blocking_event()
3418 case SWITCHDEV_PORT_OBJ_DEL: in dsa_slave_switchdev_blocking_event()
3424 case SWITCHDEV_PORT_ATTR_SET: in dsa_slave_switchdev_blocking_event()