Lines Matching refs:slave_dev

298 			struct net_device *slave_dev)  in bond_dev_queue_xmit()  argument
300 skb->dev = slave_dev; in bond_dev_queue_xmit()
307 return bond_netpoll_send_skb(bond_get_slave_by_dev(bond, slave_dev), skb); in bond_dev_queue_xmit()
684 struct net_device *slave_dev = slave->dev; in bond_update_speed_duplex() local
691 res = __ethtool_get_link_ksettings(slave_dev, &ecmd); in bond_update_speed_duplex()
742 struct net_device *slave_dev, int reporting) in bond_check_dev_link() argument
744 const struct net_device_ops *slave_ops = slave_dev->netdev_ops; in bond_check_dev_link()
749 if (!reporting && !netif_running(slave_dev)) in bond_check_dev_link()
753 return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0; in bond_check_dev_link()
756 if (slave_dev->ethtool_ops->get_link) in bond_check_dev_link()
757 return slave_dev->ethtool_ops->get_link(slave_dev) ? in bond_check_dev_link()
776 strscpy_pad(ifr.ifr_name, slave_dev->name, IFNAMSIZ); in bond_check_dev_link()
778 if (ioctl(slave_dev, &ifr, SIOCGMIIPHY) == 0) { in bond_check_dev_link()
780 if (ioctl(slave_dev, &ifr, SIOCGMIIREG) == 0) in bond_check_dev_link()
865 struct net_device *slave_dev) in bond_hw_addr_flush() argument
869 dev_uc_unsync(slave_dev, bond_dev); in bond_hw_addr_flush()
870 dev_mc_unsync(slave_dev, bond_dev); in bond_hw_addr_flush()
873 dev_mc_del(slave_dev, lacpdu_mcast_addr); in bond_hw_addr_flush()
922 struct net_device *slave_dev) in bond_set_dev_addr() argument
926 slave_dbg(bond_dev, slave_dev, "bond_dev=%p slave_dev=%p slave_dev->addr_len=%d\n", in bond_set_dev_addr()
927 bond_dev, slave_dev, slave_dev->addr_len); in bond_set_dev_addr()
928 err = dev_pre_changeaddr_notify(bond_dev, slave_dev->dev_addr, NULL); in bond_set_dev_addr()
932 __dev_addr_set(bond_dev, slave_dev->dev_addr, slave_dev->addr_len); in bond_set_dev_addr()
1501 struct net_device *slave_dev) in bond_setup_by_slave() argument
1507 bond_dev->header_ops = slave_dev->header_ops; in bond_setup_by_slave()
1509 bond_dev->type = slave_dev->type; in bond_setup_by_slave()
1510 bond_dev->hard_header_len = slave_dev->hard_header_len; in bond_setup_by_slave()
1511 bond_dev->needed_headroom = slave_dev->needed_headroom; in bond_setup_by_slave()
1512 bond_dev->addr_len = slave_dev->addr_len; in bond_setup_by_slave()
1514 memcpy(bond_dev->broadcast, slave_dev->broadcast, in bond_setup_by_slave()
1515 slave_dev->addr_len); in bond_setup_by_slave()
1517 if (slave_dev->flags & IFF_POINTOPOINT) { in bond_setup_by_slave()
1703 struct net_device *slave_dev) in bond_alloc_slave() argument
1712 slave->dev = slave_dev; in bond_alloc_slave()
1784 #define SLAVE_NL_ERR(bond_dev, slave_dev, extack, errmsg) do { \ argument
1788 slave_err(bond_dev, slave_dev, "Error: %s\n", errmsg); \
1828 int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev, in bond_enslave() argument
1832 const struct net_device_ops *slave_ops = slave_dev->netdev_ops; in bond_enslave()
1838 if (slave_dev->flags & IFF_MASTER && in bond_enslave()
1839 !netif_is_bond_master(slave_dev)) { in bond_enslave()
1846 slave_dev->ethtool_ops->get_link == NULL && in bond_enslave()
1848 slave_warn(bond_dev, slave_dev, "no link monitoring support\n"); in bond_enslave()
1852 if (netdev_is_rx_handler_busy(slave_dev)) { in bond_enslave()
1853 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
1858 if (bond_dev == slave_dev) { in bond_enslave()
1865 if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) { in bond_enslave()
1866 slave_dbg(bond_dev, slave_dev, "is NETIF_F_VLAN_CHALLENGED\n"); in bond_enslave()
1868 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
1872 …slave_warn(bond_dev, slave_dev, "enslaved VLAN challenged slave. Adding VLANs will be blocked as l… in bond_enslave()
1875 slave_dbg(bond_dev, slave_dev, "is !NETIF_F_VLAN_CHALLENGED\n"); in bond_enslave()
1878 if (slave_dev->features & NETIF_F_HW_ESP) in bond_enslave()
1879 slave_dbg(bond_dev, slave_dev, "is esp-hw-offload capable\n"); in bond_enslave()
1886 if (slave_dev->flags & IFF_UP) { in bond_enslave()
1887 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
1900 if (bond_dev->type != slave_dev->type) { in bond_enslave()
1901 slave_dbg(bond_dev, slave_dev, "change device type from %d to %d\n", in bond_enslave()
1902 bond_dev->type, slave_dev->type); in bond_enslave()
1908 slave_err(bond_dev, slave_dev, "refused to change device type\n"); in bond_enslave()
1916 if (slave_dev->type != ARPHRD_ETHER) in bond_enslave()
1917 bond_setup_by_slave(bond_dev, slave_dev); in bond_enslave()
1924 } else if (bond_dev->type != slave_dev->type) { in bond_enslave()
1925 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
1930 if (slave_dev->type == ARPHRD_INFINIBAND && in bond_enslave()
1932 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
1939 slave_dev->type == ARPHRD_INFINIBAND) { in bond_enslave()
1940 …slave_warn(bond_dev, slave_dev, "The slave device specified does not support setting the MAC addre… in bond_enslave()
1945 slave_warn(bond_dev, slave_dev, "Setting fail_over_mac to active for active-backup mode\n"); in bond_enslave()
1947 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
1955 call_netdevice_notifiers(NETDEV_JOIN, slave_dev); in bond_enslave()
1962 res = bond_set_dev_addr(bond->dev, slave_dev); in bond_enslave()
1967 new_slave = bond_alloc_slave(bond, slave_dev); in bond_enslave()
1979 new_slave->original_mtu = slave_dev->mtu; in bond_enslave()
1980 res = dev_set_mtu(slave_dev, bond->dev->mtu); in bond_enslave()
1982 slave_err(bond_dev, slave_dev, "Error %d calling dev_set_mtu\n", res); in bond_enslave()
1990 bond_hw_addr_copy(new_slave->perm_hwaddr, slave_dev->dev_addr, in bond_enslave()
1991 slave_dev->addr_len); in bond_enslave()
1999 ss.ss_family = slave_dev->type; in bond_enslave()
2000 res = dev_set_mac_address(slave_dev, (struct sockaddr *)&ss, in bond_enslave()
2003 slave_err(bond_dev, slave_dev, "Error %d calling set_mac_address\n", res); in bond_enslave()
2009 slave_dev->priv_flags |= IFF_NO_ADDRCONF; in bond_enslave()
2012 res = dev_open(slave_dev, extack); in bond_enslave()
2014 slave_err(bond_dev, slave_dev, "Opening slave failed\n"); in bond_enslave()
2018 slave_dev->priv_flags |= IFF_BONDING; in bond_enslave()
2031 res = vlan_vids_add_by_dev(slave_dev, bond_dev); in bond_enslave()
2033 slave_err(bond_dev, slave_dev, "Couldn't add bond vlan ids\n"); in bond_enslave()
2054 link_reporting = bond_check_dev_link(bond, slave_dev, 1); in bond_enslave()
2065 …slave_warn(bond_dev, slave_dev, "MII and ETHTOOL support not available for slave, and arp_interval… in bond_enslave()
2068 …slave_warn(bond_dev, slave_dev, "can't get link status from slave; the network driver associated w… in bond_enslave()
2075 if (bond_check_dev_link(bond, slave_dev, 0) == BMSR_LSTATUS) { in bond_enslave()
2092 (netif_carrier_ok(slave_dev) ? in bond_enslave()
2102 slave_dbg(bond_dev, slave_dev, "Initial state of slave is BOND_LINK_%s\n", in bond_enslave()
2145 slave_dbg(bond_dev, slave_dev, "This slave is always active in trunk mode\n"); in bond_enslave()
2164 …slave_info(bond_dev, slave_dev, "master_dev is using netpoll, but new slave device does not suppor… in bond_enslave()
2172 dev_disable_lro(slave_dev); in bond_enslave()
2174 res = netdev_rx_handler_register(slave_dev, bond_handle_frame, in bond_enslave()
2177 slave_dbg(bond_dev, slave_dev, "Error %d calling netdev_rx_handler_register\n", res); in bond_enslave()
2183 slave_dbg(bond_dev, slave_dev, "Error %d calling bond_master_upper_dev_link\n", res); in bond_enslave()
2191 slave_dbg(bond_dev, slave_dev, "Error %d calling bond_sysfs_slave_add\n", res); in bond_enslave()
2201 res = dev_set_promiscuity(slave_dev, 1); in bond_enslave()
2208 res = dev_set_allmulti(slave_dev, 1); in bond_enslave()
2211 dev_set_promiscuity(slave_dev, -1); in bond_enslave()
2218 dev_mc_sync_multiple(slave_dev, bond_dev); in bond_enslave()
2219 dev_uc_sync_multiple(slave_dev, bond_dev); in bond_enslave()
2223 dev_mc_add(slave_dev, lacpdu_mcast_addr); in bond_enslave()
2241 if (!slave_dev->netdev_ops->ndo_bpf || in bond_enslave()
2242 !slave_dev->netdev_ops->ndo_xdp_xmit) { in bond_enslave()
2244 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
2257 if (dev_xdp_prog_count(slave_dev) > 0) { in bond_enslave()
2258 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
2264 res = slave_dev->netdev_ops->ndo_bpf(slave_dev, &xdp); in bond_enslave()
2267 slave_dbg(bond_dev, slave_dev, "Error %d calling ndo_bpf\n", res); in bond_enslave()
2276 slave_info(bond_dev, slave_dev, "Enslaving as %s interface with %s link\n", in bond_enslave()
2292 netdev_rx_handler_unregister(slave_dev); in bond_enslave()
2295 vlan_vids_del_by_dev(slave_dev, bond_dev); in bond_enslave()
2309 if (!netif_is_bond_master(slave_dev)) in bond_enslave()
2310 slave_dev->priv_flags &= ~IFF_BONDING; in bond_enslave()
2311 dev_close(slave_dev); in bond_enslave()
2314 slave_dev->priv_flags &= ~IFF_NO_ADDRCONF; in bond_enslave()
2323 ss.ss_family = slave_dev->type; in bond_enslave()
2324 dev_set_mac_address(slave_dev, (struct sockaddr *)&ss, NULL); in bond_enslave()
2328 dev_set_mtu(slave_dev, new_slave->original_mtu); in bond_enslave()
2337 slave_dev->dev_addr)) in bond_enslave()
2360 struct net_device *slave_dev, in __bond_release_one() argument
2370 if (!(slave_dev->flags & IFF_SLAVE) || in __bond_release_one()
2371 !netdev_has_upper_dev(slave_dev, bond_dev)) { in __bond_release_one()
2372 slave_dbg(bond_dev, slave_dev, "cannot release slave\n"); in __bond_release_one()
2378 slave = bond_get_slave_by_dev(bond, slave_dev); in __bond_release_one()
2381 slave_info(bond_dev, slave_dev, "interface not enslaved\n"); in __bond_release_one()
2400 if (slave_dev->netdev_ops->ndo_bpf(slave_dev, &xdp)) in __bond_release_one()
2401 slave_warn(bond_dev, slave_dev, "failed to unload XDP program\n"); in __bond_release_one()
2407 netdev_rx_handler_unregister(slave_dev); in __bond_release_one()
2417 slave_info(bond_dev, slave_dev, "Releasing %s interface\n", in __bond_release_one()
2428 …slave_warn(bond_dev, slave_dev, "the permanent HWaddr of slave - %pM - is still in use by bond - s… in __bond_release_one()
2473 …slave_info(bond_dev, slave_dev, "last VLAN challenged slave left bond - VLAN blocking is removed\n… in __bond_release_one()
2475 vlan_vids_del_by_dev(slave_dev, bond_dev); in __bond_release_one()
2489 dev_set_promiscuity(slave_dev, -1); in __bond_release_one()
2493 dev_set_allmulti(slave_dev, -1); in __bond_release_one()
2496 bond_hw_addr_flush(bond_dev, slave_dev); in __bond_release_one()
2502 dev_close(slave_dev); in __bond_release_one()
2504 slave_dev->priv_flags &= ~IFF_NO_ADDRCONF; in __bond_release_one()
2511 ss.ss_family = slave_dev->type; in __bond_release_one()
2512 dev_set_mac_address(slave_dev, (struct sockaddr *)&ss, NULL); in __bond_release_one()
2516 __dev_set_mtu(slave_dev, slave->original_mtu); in __bond_release_one()
2518 dev_set_mtu(slave_dev, slave->original_mtu); in __bond_release_one()
2520 if (!netif_is_bond_master(slave_dev)) in __bond_release_one()
2521 slave_dev->priv_flags &= ~IFF_BONDING; in __bond_release_one()
2530 int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) in bond_release() argument
2532 return __bond_release_one(bond_dev, slave_dev, false, false); in bond_release()
2539 struct net_device *slave_dev) in bond_release_and_destroy() argument
2544 ret = __bond_release_one(bond_dev, slave_dev, false, true); in bond_release_and_destroy()
2895 struct net_device *slave_dev = slave->dev; in bond_handle_vlan() local
2910 slave_dbg(bond_dev, slave_dev, "inner tag: proto %X vid %X\n", in bond_handle_vlan()
2923 slave_dbg(bond_dev, slave_dev, "outer tag: proto %X vid %X\n", in bond_handle_vlan()
2940 struct net_device *slave_dev = slave->dev; in bond_arp_send() local
2943 slave_dbg(bond_dev, slave_dev, "arp %d on slave: dst %pI4 src %pI4\n", in bond_arp_send()
2946 skb = arp_create(arp_op, ETH_P_ARP, dest_ip, slave_dev, src_ip, in bond_arp_send()
2947 NULL, slave_dev->dev_addr, NULL); in bond_arp_send()
3161 struct net_device *slave_dev = slave->dev; in bond_ns_send() local
3165 slave_dbg(bond_dev, slave_dev, "NS on slave: dst %pI6c src %pI6c\n", in bond_ns_send()
3168 skb = ndisc_ns_create(slave_dev, daddr, saddr, 0); in bond_ns_send()
3870 struct net_device *slave_dev) in bond_slave_netdev_event() argument
3872 struct slave *slave = bond_slave_get_rtnl(slave_dev), *primary; in bond_slave_netdev_event()
3881 netdev_dbg(slave_dev, "%s called on NULL slave\n", __func__); in bond_slave_netdev_event()
3889 slave_dbg(bond_dev, slave_dev, "%s called\n", __func__); in bond_slave_netdev_event()
3894 bond_release_and_destroy(bond_dev, slave_dev); in bond_slave_netdev_event()
3896 __bond_release_one(bond_dev, slave_dev, false, true); in bond_slave_netdev_event()
3952 } else if (!strcmp(slave_dev->name, bond->params.primary)) { in bond_slave_netdev_event()
3960 primary ? slave_dev->name : "none"); in bond_slave_netdev_event()
4494 struct net_device *slave_dev = NULL; in bond_do_ioctl() local
4538 slave_dev = __dev_get_by_name(net, ifr->ifr_slave); in bond_do_ioctl()
4540 slave_dbg(bond_dev, slave_dev, "slave_dev=%p:\n", slave_dev); in bond_do_ioctl()
4542 if (!slave_dev) in bond_do_ioctl()
4547 res = bond_enslave(bond_dev, slave_dev, NULL); in bond_do_ioctl()
4550 res = bond_release(bond_dev, slave_dev); in bond_do_ioctl()
4553 res = bond_set_dev_addr(bond_dev, slave_dev); in bond_do_ioctl()
4556 bond_opt_initstr(&newval, slave_dev->name); in bond_do_ioctl()
5520 struct net_device *slave_dev; in bond_xdp_xmit() local
5525 slave_dev = bond_xdp_get_xmit_slave(bond_dev, &xdp); in bond_xdp_xmit()
5526 if (!slave_dev) { in bond_xdp_xmit()
5531 err = slave_dev->netdev_ops->ndo_xdp_xmit(slave_dev, 1, frames1, flags); in bond_xdp_xmit()
5571 struct net_device *slave_dev = slave->dev; in bond_xdp_set() local
5573 if (!slave_dev->netdev_ops->ndo_bpf || in bond_xdp_set()
5574 !slave_dev->netdev_ops->ndo_xdp_xmit) { in bond_xdp_set()
5575 SLAVE_NL_ERR(dev, slave_dev, extack, in bond_xdp_set()
5581 if (dev_xdp_prog_count(slave_dev) > 0) { in bond_xdp_set()
5582 SLAVE_NL_ERR(dev, slave_dev, extack, in bond_xdp_set()
5588 err = slave_dev->netdev_ops->ndo_bpf(slave_dev, &xdp); in bond_xdp_set()
5591 slave_err(dev, slave_dev, "Error %d calling ndo_bpf\n", err); in bond_xdp_set()
5614 struct net_device *slave_dev = rollback_slave->dev; in bond_xdp_set() local
5620 err_unwind = slave_dev->netdev_ops->ndo_bpf(slave_dev, &xdp); in bond_xdp_set()
5622 slave_err(dev, slave_dev, in bond_xdp_set()