Lines Matching refs:slave_dev
293 struct net_device *slave_dev) in bond_dev_queue_xmit() argument
295 skb->dev = slave_dev; in bond_dev_queue_xmit()
302 return bond_netpoll_send_skb(bond_get_slave_by_dev(bond, slave_dev), skb); in bond_dev_queue_xmit()
677 struct net_device *slave_dev = slave->dev; in bond_update_speed_duplex() local
684 res = __ethtool_get_link_ksettings(slave_dev, &ecmd); in bond_update_speed_duplex()
735 struct net_device *slave_dev, int reporting) in bond_check_dev_link() argument
737 const struct net_device_ops *slave_ops = slave_dev->netdev_ops; in bond_check_dev_link()
742 if (!reporting && !netif_running(slave_dev)) in bond_check_dev_link()
746 return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0; in bond_check_dev_link()
749 if (slave_dev->ethtool_ops->get_link) in bond_check_dev_link()
750 return slave_dev->ethtool_ops->get_link(slave_dev) ? in bond_check_dev_link()
769 strscpy_pad(ifr.ifr_name, slave_dev->name, IFNAMSIZ); in bond_check_dev_link()
771 if (ioctl(slave_dev, &ifr, SIOCGMIIPHY) == 0) { in bond_check_dev_link()
773 if (ioctl(slave_dev, &ifr, SIOCGMIIREG) == 0) in bond_check_dev_link()
858 struct net_device *slave_dev) in bond_hw_addr_flush() argument
862 dev_uc_unsync(slave_dev, bond_dev); in bond_hw_addr_flush()
863 dev_mc_unsync(slave_dev, bond_dev); in bond_hw_addr_flush()
869 dev_mc_del(slave_dev, lacpdu_multicast); in bond_hw_addr_flush()
916 struct net_device *slave_dev) in bond_set_dev_addr() argument
920 slave_dbg(bond_dev, slave_dev, "bond_dev=%p slave_dev=%p slave_dev->addr_len=%d\n", in bond_set_dev_addr()
921 bond_dev, slave_dev, slave_dev->addr_len); in bond_set_dev_addr()
922 err = dev_pre_changeaddr_notify(bond_dev, slave_dev->dev_addr, NULL); in bond_set_dev_addr()
926 memcpy(bond_dev->dev_addr, slave_dev->dev_addr, slave_dev->addr_len); in bond_set_dev_addr()
1475 struct net_device *slave_dev) in bond_setup_by_slave() argument
1477 bond_dev->header_ops = slave_dev->header_ops; in bond_setup_by_slave()
1479 bond_dev->type = slave_dev->type; in bond_setup_by_slave()
1480 bond_dev->hard_header_len = slave_dev->hard_header_len; in bond_setup_by_slave()
1481 bond_dev->needed_headroom = slave_dev->needed_headroom; in bond_setup_by_slave()
1482 bond_dev->addr_len = slave_dev->addr_len; in bond_setup_by_slave()
1484 memcpy(bond_dev->broadcast, slave_dev->broadcast, in bond_setup_by_slave()
1485 slave_dev->addr_len); in bond_setup_by_slave()
1660 struct net_device *slave_dev) in bond_alloc_slave() argument
1669 slave->dev = slave_dev; in bond_alloc_slave()
1741 #define SLAVE_NL_ERR(bond_dev, slave_dev, extack, errmsg) do { \ argument
1745 slave_err(bond_dev, slave_dev, "Error: %s\n", errmsg); \
1749 int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev, in bond_enslave() argument
1753 const struct net_device_ops *slave_ops = slave_dev->netdev_ops; in bond_enslave()
1759 if (slave_dev->flags & IFF_MASTER && in bond_enslave()
1760 !netif_is_bond_master(slave_dev)) { in bond_enslave()
1767 slave_dev->ethtool_ops->get_link == NULL && in bond_enslave()
1769 slave_warn(bond_dev, slave_dev, "no link monitoring support\n"); in bond_enslave()
1773 if (netdev_is_rx_handler_busy(slave_dev)) { in bond_enslave()
1774 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
1779 if (bond_dev == slave_dev) { in bond_enslave()
1786 if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) { in bond_enslave()
1787 slave_dbg(bond_dev, slave_dev, "is NETIF_F_VLAN_CHALLENGED\n"); in bond_enslave()
1789 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
1793 …slave_warn(bond_dev, slave_dev, "enslaved VLAN challenged slave. Adding VLANs will be blocked as l… in bond_enslave()
1796 slave_dbg(bond_dev, slave_dev, "is !NETIF_F_VLAN_CHALLENGED\n"); in bond_enslave()
1799 if (slave_dev->features & NETIF_F_HW_ESP) in bond_enslave()
1800 slave_dbg(bond_dev, slave_dev, "is esp-hw-offload capable\n"); in bond_enslave()
1807 if (slave_dev->flags & IFF_UP) { in bond_enslave()
1808 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
1821 if (bond_dev->type != slave_dev->type) { in bond_enslave()
1822 slave_dbg(bond_dev, slave_dev, "change device type from %d to %d\n", in bond_enslave()
1823 bond_dev->type, slave_dev->type); in bond_enslave()
1829 slave_err(bond_dev, slave_dev, "refused to change device type\n"); in bond_enslave()
1837 if (slave_dev->type != ARPHRD_ETHER) in bond_enslave()
1838 bond_setup_by_slave(bond_dev, slave_dev); in bond_enslave()
1847 } else if (bond_dev->type != slave_dev->type) { in bond_enslave()
1848 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
1853 if (slave_dev->type == ARPHRD_INFINIBAND && in bond_enslave()
1855 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
1862 slave_dev->type == ARPHRD_INFINIBAND) { in bond_enslave()
1863 …slave_warn(bond_dev, slave_dev, "The slave device specified does not support setting the MAC addre… in bond_enslave()
1868 slave_warn(bond_dev, slave_dev, "Setting fail_over_mac to active for active-backup mode\n"); in bond_enslave()
1870 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
1878 call_netdevice_notifiers(NETDEV_JOIN, slave_dev); in bond_enslave()
1885 res = bond_set_dev_addr(bond->dev, slave_dev); in bond_enslave()
1890 new_slave = bond_alloc_slave(bond, slave_dev); in bond_enslave()
1902 new_slave->original_mtu = slave_dev->mtu; in bond_enslave()
1903 res = dev_set_mtu(slave_dev, bond->dev->mtu); in bond_enslave()
1905 slave_err(bond_dev, slave_dev, "Error %d calling dev_set_mtu\n", res); in bond_enslave()
1913 bond_hw_addr_copy(new_slave->perm_hwaddr, slave_dev->dev_addr, in bond_enslave()
1914 slave_dev->addr_len); in bond_enslave()
1922 ss.ss_family = slave_dev->type; in bond_enslave()
1923 res = dev_set_mac_address(slave_dev, (struct sockaddr *)&ss, in bond_enslave()
1926 slave_err(bond_dev, slave_dev, "Error %d calling set_mac_address\n", res); in bond_enslave()
1932 slave_dev->flags |= IFF_SLAVE; in bond_enslave()
1935 res = dev_open(slave_dev, extack); in bond_enslave()
1937 slave_err(bond_dev, slave_dev, "Opening slave failed\n"); in bond_enslave()
1941 slave_dev->priv_flags |= IFF_BONDING; in bond_enslave()
1954 res = vlan_vids_add_by_dev(slave_dev, bond_dev); in bond_enslave()
1956 slave_err(bond_dev, slave_dev, "Couldn't add bond vlan ids\n"); in bond_enslave()
1975 link_reporting = bond_check_dev_link(bond, slave_dev, 1); in bond_enslave()
1986 …slave_warn(bond_dev, slave_dev, "MII and ETHTOOL support not available for slave, and arp_interval… in bond_enslave()
1989 …slave_warn(bond_dev, slave_dev, "can't get link status from slave; the network driver associated w… in bond_enslave()
1996 if (bond_check_dev_link(bond, slave_dev, 0) == BMSR_LSTATUS) { in bond_enslave()
2013 (netif_carrier_ok(slave_dev) ? in bond_enslave()
2023 slave_dbg(bond_dev, slave_dev, "Initial state of slave is BOND_LINK_%s\n", in bond_enslave()
2066 slave_dbg(bond_dev, slave_dev, "This slave is always active in trunk mode\n"); in bond_enslave()
2085 …slave_info(bond_dev, slave_dev, "master_dev is using netpoll, but new slave device does not suppor… in bond_enslave()
2093 dev_disable_lro(slave_dev); in bond_enslave()
2095 res = netdev_rx_handler_register(slave_dev, bond_handle_frame, in bond_enslave()
2098 slave_dbg(bond_dev, slave_dev, "Error %d calling netdev_rx_handler_register\n", res); in bond_enslave()
2104 slave_dbg(bond_dev, slave_dev, "Error %d calling bond_master_upper_dev_link\n", res); in bond_enslave()
2112 slave_dbg(bond_dev, slave_dev, "Error %d calling bond_sysfs_slave_add\n", res); in bond_enslave()
2122 res = dev_set_promiscuity(slave_dev, 1); in bond_enslave()
2129 res = dev_set_allmulti(slave_dev, 1); in bond_enslave()
2132 dev_set_promiscuity(slave_dev, -1); in bond_enslave()
2138 dev_mc_sync_multiple(slave_dev, bond_dev); in bond_enslave()
2139 dev_uc_sync_multiple(slave_dev, bond_dev); in bond_enslave()
2146 dev_mc_add(slave_dev, lacpdu_multicast); in bond_enslave()
2164 if (!slave_dev->netdev_ops->ndo_bpf || in bond_enslave()
2165 !slave_dev->netdev_ops->ndo_xdp_xmit) { in bond_enslave()
2167 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
2180 if (dev_xdp_prog_count(slave_dev) > 0) { in bond_enslave()
2181 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
2187 res = slave_dev->netdev_ops->ndo_bpf(slave_dev, &xdp); in bond_enslave()
2190 slave_dbg(bond_dev, slave_dev, "Error %d calling ndo_bpf\n", res); in bond_enslave()
2197 slave_info(bond_dev, slave_dev, "Enslaving as %s interface with %s link\n", in bond_enslave()
2213 netdev_rx_handler_unregister(slave_dev); in bond_enslave()
2216 vlan_vids_del_by_dev(slave_dev, bond_dev); in bond_enslave()
2230 if (!netif_is_bond_master(slave_dev)) in bond_enslave()
2231 slave_dev->priv_flags &= ~IFF_BONDING; in bond_enslave()
2232 dev_close(slave_dev); in bond_enslave()
2235 slave_dev->flags &= ~IFF_SLAVE; in bond_enslave()
2244 ss.ss_family = slave_dev->type; in bond_enslave()
2245 dev_set_mac_address(slave_dev, (struct sockaddr *)&ss, NULL); in bond_enslave()
2249 dev_set_mtu(slave_dev, new_slave->original_mtu); in bond_enslave()
2258 slave_dev->dev_addr)) in bond_enslave()
2283 struct net_device *slave_dev, in __bond_release_one() argument
2293 if (!(slave_dev->flags & IFF_SLAVE) || in __bond_release_one()
2294 !netdev_has_upper_dev(slave_dev, bond_dev)) { in __bond_release_one()
2295 slave_dbg(bond_dev, slave_dev, "cannot release slave\n"); in __bond_release_one()
2301 slave = bond_get_slave_by_dev(bond, slave_dev); in __bond_release_one()
2304 slave_info(bond_dev, slave_dev, "interface not enslaved\n"); in __bond_release_one()
2323 if (slave_dev->netdev_ops->ndo_bpf(slave_dev, &xdp)) in __bond_release_one()
2324 slave_warn(bond_dev, slave_dev, "failed to unload XDP program\n"); in __bond_release_one()
2330 netdev_rx_handler_unregister(slave_dev); in __bond_release_one()
2340 slave_info(bond_dev, slave_dev, "Releasing %s interface\n", in __bond_release_one()
2351 …slave_warn(bond_dev, slave_dev, "the permanent HWaddr of slave - %pM - is still in use by bond - s… in __bond_release_one()
2397 …slave_info(bond_dev, slave_dev, "last VLAN challenged slave left bond - VLAN blocking is removed\n… in __bond_release_one()
2399 vlan_vids_del_by_dev(slave_dev, bond_dev); in __bond_release_one()
2413 dev_set_promiscuity(slave_dev, -1); in __bond_release_one()
2417 dev_set_allmulti(slave_dev, -1); in __bond_release_one()
2419 bond_hw_addr_flush(bond_dev, slave_dev); in __bond_release_one()
2425 dev_close(slave_dev); in __bond_release_one()
2432 ss.ss_family = slave_dev->type; in __bond_release_one()
2433 dev_set_mac_address(slave_dev, (struct sockaddr *)&ss, NULL); in __bond_release_one()
2437 __dev_set_mtu(slave_dev, slave->original_mtu); in __bond_release_one()
2439 dev_set_mtu(slave_dev, slave->original_mtu); in __bond_release_one()
2441 if (!netif_is_bond_master(slave_dev)) in __bond_release_one()
2442 slave_dev->priv_flags &= ~IFF_BONDING; in __bond_release_one()
2450 int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) in bond_release() argument
2452 return __bond_release_one(bond_dev, slave_dev, false, false); in bond_release()
2459 struct net_device *slave_dev) in bond_release_and_destroy() argument
2464 ret = __bond_release_one(bond_dev, slave_dev, false, true); in bond_release_and_destroy()
2804 struct net_device *slave_dev = slave->dev; in bond_arp_send() local
2807 slave_dbg(bond_dev, slave_dev, "arp %d on slave: dst %pI4 src %pI4\n", in bond_arp_send()
2810 skb = arp_create(arp_op, ETH_P_ARP, dest_ip, slave_dev, src_ip, in bond_arp_send()
2811 NULL, slave_dev->dev_addr, NULL); in bond_arp_send()
2830 slave_dbg(bond_dev, slave_dev, "inner tag: proto %X vid %X\n", in bond_arp_send()
2843 slave_dbg(bond_dev, slave_dev, "outer tag: proto %X vid %X\n", in bond_arp_send()
3541 struct net_device *slave_dev) in bond_slave_netdev_event() argument
3543 struct slave *slave = bond_slave_get_rtnl(slave_dev), *primary; in bond_slave_netdev_event()
3552 netdev_dbg(slave_dev, "%s called on NULL slave\n", __func__); in bond_slave_netdev_event()
3560 slave_dbg(bond_dev, slave_dev, "%s called\n", __func__); in bond_slave_netdev_event()
3565 bond_release_and_destroy(bond_dev, slave_dev); in bond_slave_netdev_event()
3567 __bond_release_one(bond_dev, slave_dev, false, true); in bond_slave_netdev_event()
3623 } else if (!strcmp(slave_dev->name, bond->params.primary)) { in bond_slave_netdev_event()
3631 primary ? slave_dev->name : "none"); in bond_slave_netdev_event()
4131 struct net_device *slave_dev = NULL; in bond_do_ioctl() local
4175 slave_dev = __dev_get_by_name(net, ifr->ifr_slave); in bond_do_ioctl()
4177 slave_dbg(bond_dev, slave_dev, "slave_dev=%p:\n", slave_dev); in bond_do_ioctl()
4179 if (!slave_dev) in bond_do_ioctl()
4184 res = bond_enslave(bond_dev, slave_dev, NULL); in bond_do_ioctl()
4187 res = bond_release(bond_dev, slave_dev); in bond_do_ioctl()
4190 res = bond_set_dev_addr(bond_dev, slave_dev); in bond_do_ioctl()
4193 bond_opt_initstr(&newval, slave_dev->name); in bond_do_ioctl()
5149 struct net_device *slave_dev; in bond_xdp_xmit() local
5154 slave_dev = bond_xdp_get_xmit_slave(bond_dev, &xdp); in bond_xdp_xmit()
5155 if (!slave_dev) { in bond_xdp_xmit()
5160 err = slave_dev->netdev_ops->ndo_xdp_xmit(slave_dev, 1, frames1, flags); in bond_xdp_xmit()
5200 struct net_device *slave_dev = slave->dev; in bond_xdp_set() local
5202 if (!slave_dev->netdev_ops->ndo_bpf || in bond_xdp_set()
5203 !slave_dev->netdev_ops->ndo_xdp_xmit) { in bond_xdp_set()
5204 SLAVE_NL_ERR(dev, slave_dev, extack, in bond_xdp_set()
5210 if (dev_xdp_prog_count(slave_dev) > 0) { in bond_xdp_set()
5211 SLAVE_NL_ERR(dev, slave_dev, extack, in bond_xdp_set()
5217 err = slave_dev->netdev_ops->ndo_bpf(slave_dev, &xdp); in bond_xdp_set()
5220 slave_err(dev, slave_dev, "Error %d calling ndo_bpf\n", err); in bond_xdp_set()
5243 struct net_device *slave_dev = rollback_slave->dev; in bond_xdp_set() local
5249 err_unwind = slave_dev->netdev_ops->ndo_bpf(slave_dev, &xdp); in bond_xdp_set()
5251 slave_err(dev, slave_dev, in bond_xdp_set()