Lines Matching refs:bond_dev

261 static int bond_init(struct net_device *bond_dev);
262 static void bond_uninit(struct net_device *bond_dev);
263 static void bond_get_stats(struct net_device *bond_dev,
368 static int bond_vlan_rx_add_vid(struct net_device *bond_dev, in bond_vlan_rx_add_vid() argument
371 struct bonding *bond = netdev_priv(bond_dev); in bond_vlan_rx_add_vid()
402 static int bond_vlan_rx_kill_vid(struct net_device *bond_dev, in bond_vlan_rx_kill_vid() argument
405 struct bonding *bond = netdev_priv(bond_dev); in bond_vlan_rx_kill_vid()
429 struct net_device *bond_dev = xs->xso.dev; in bond_ipsec_add_sa() local
435 if (!bond_dev) in bond_ipsec_add_sa()
439 bond = netdev_priv(bond_dev); in bond_ipsec_add_sa()
477 struct net_device *bond_dev = bond->dev; in bond_ipsec_add_sa_all() local
491 slave_warn(bond_dev, slave->dev, in bond_ipsec_add_sa_all()
502 slave_warn(bond_dev, slave->dev, "%s: failed to add SA\n", __func__); in bond_ipsec_add_sa_all()
517 struct net_device *bond_dev = xs->xso.dev; in bond_ipsec_del_sa() local
522 if (!bond_dev) in bond_ipsec_del_sa()
526 bond = netdev_priv(bond_dev); in bond_ipsec_del_sa()
540 slave_warn(bond_dev, slave->dev, "%s: no slave xdo_dev_state_delete\n", __func__); in bond_ipsec_del_sa()
560 struct net_device *bond_dev = bond->dev; in bond_ipsec_del_sa_all() local
579 slave_warn(bond_dev, slave->dev, in bond_ipsec_del_sa_all()
598 struct net_device *bond_dev = xs->xso.dev; in bond_ipsec_offload_ok() local
604 bond = netdev_priv(bond_dev); in bond_ipsec_offload_ok()
864 static void bond_hw_addr_flush(struct net_device *bond_dev, in bond_hw_addr_flush() argument
867 struct bonding *bond = netdev_priv(bond_dev); in bond_hw_addr_flush()
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()
921 static int bond_set_dev_addr(struct net_device *bond_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()
933 bond_dev->addr_assign_type = NET_ADDR_STOLEN; in bond_set_dev_addr()
934 call_netdevice_notifiers(NETDEV_CHANGEADDR, bond_dev); in bond_set_dev_addr()
1327 static void bond_poll_controller(struct net_device *bond_dev) in bond_poll_controller() argument
1329 struct bonding *bond = netdev_priv(bond_dev); in bond_poll_controller()
1355 static void bond_netpoll_cleanup(struct net_device *bond_dev) in bond_netpoll_cleanup() argument
1357 struct bonding *bond = netdev_priv(bond_dev); in bond_netpoll_cleanup()
1390 static void bond_netpoll_cleanup(struct net_device *bond_dev) in bond_netpoll_cleanup() argument
1441 struct net_device *bond_dev = bond->dev; in bond_compute_features() local
1478 bond_dev->hard_header_len = max_hard_header_len; in bond_compute_features()
1481 bond_dev->vlan_features = vlan_features; in bond_compute_features()
1482 bond_dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL | in bond_compute_features()
1486 bond_dev->hw_enc_features |= xfrm_features; in bond_compute_features()
1488 bond_dev->mpls_features = mpls_features; in bond_compute_features()
1489 netif_set_tso_max_segs(bond_dev, tso_max_segs); in bond_compute_features()
1490 netif_set_tso_max_size(bond_dev, tso_max_size); in bond_compute_features()
1492 bond_dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; in bond_compute_features()
1493 if ((bond_dev->priv_flags & IFF_XMIT_DST_RELEASE_PERM) && in bond_compute_features()
1495 bond_dev->priv_flags |= IFF_XMIT_DST_RELEASE; in bond_compute_features()
1497 netdev_change_features(bond_dev); in bond_compute_features()
1500 static void bond_setup_by_slave(struct net_device *bond_dev, in bond_setup_by_slave() argument
1503 bond_dev->header_ops = slave_dev->header_ops; in bond_setup_by_slave()
1505 bond_dev->type = slave_dev->type; in bond_setup_by_slave()
1506 bond_dev->hard_header_len = slave_dev->hard_header_len; in bond_setup_by_slave()
1507 bond_dev->needed_headroom = slave_dev->needed_headroom; in bond_setup_by_slave()
1508 bond_dev->addr_len = slave_dev->addr_len; in bond_setup_by_slave()
1510 memcpy(bond_dev->broadcast, slave_dev->broadcast, in bond_setup_by_slave()
1514 bond_dev->flags &= ~(IFF_BROADCAST | IFF_MULTICAST); in bond_setup_by_slave()
1515 bond_dev->flags |= (IFF_POINTOPOINT | IFF_NOARP); in bond_setup_by_slave()
1771 #define BOND_NL_ERR(bond_dev, extack, errmsg) do { \ argument
1775 netdev_err(bond_dev, "Error: %s\n", errmsg); \
1778 #define SLAVE_NL_ERR(bond_dev, slave_dev, extack, errmsg) do { \ argument
1782 slave_err(bond_dev, slave_dev, "Error: %s\n", errmsg); \
1790 static void bond_ether_setup(struct net_device *bond_dev) in bond_ether_setup() argument
1792 unsigned int flags = bond_dev->flags & (IFF_SLAVE | IFF_UP); in bond_ether_setup()
1794 ether_setup(bond_dev); in bond_ether_setup()
1795 bond_dev->flags |= IFF_MASTER | flags; in bond_ether_setup()
1796 bond_dev->priv_flags &= ~IFF_TX_SKB_SHARING; in bond_ether_setup()
1799 void bond_xdp_set_features(struct net_device *bond_dev) in bond_xdp_set_features() argument
1801 struct bonding *bond = netdev_priv(bond_dev); in bond_xdp_set_features()
1809 xdp_clear_features_flag(bond_dev); in bond_xdp_set_features()
1816 xdp_set_features_flag(bond_dev, val); in bond_xdp_set_features()
1820 int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev, in bond_enslave() argument
1823 struct bonding *bond = netdev_priv(bond_dev); in bond_enslave()
1832 BOND_NL_ERR(bond_dev, extack, in bond_enslave()
1840 slave_warn(bond_dev, slave_dev, "no link monitoring support\n"); in bond_enslave()
1845 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
1850 if (bond_dev == slave_dev) { in bond_enslave()
1851 BOND_NL_ERR(bond_dev, extack, "Cannot enslave bond to itself."); in bond_enslave()
1858 slave_dbg(bond_dev, slave_dev, "is NETIF_F_VLAN_CHALLENGED\n"); in bond_enslave()
1859 if (vlan_uses_dev(bond_dev)) { in bond_enslave()
1860 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
1864 …slave_warn(bond_dev, slave_dev, "enslaved VLAN challenged slave. Adding VLANs will be blocked as l… in bond_enslave()
1867 slave_dbg(bond_dev, slave_dev, "is !NETIF_F_VLAN_CHALLENGED\n"); in bond_enslave()
1871 slave_dbg(bond_dev, slave_dev, "is esp-hw-offload capable\n"); in bond_enslave()
1879 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
1892 if (bond_dev->type != slave_dev->type) { in bond_enslave()
1893 slave_dbg(bond_dev, slave_dev, "change device type from %d to %d\n", in bond_enslave()
1894 bond_dev->type, slave_dev->type); in bond_enslave()
1897 bond_dev); in bond_enslave()
1900 slave_err(bond_dev, slave_dev, "refused to change device type\n"); in bond_enslave()
1905 dev_uc_flush(bond_dev); in bond_enslave()
1906 dev_mc_flush(bond_dev); in bond_enslave()
1909 bond_setup_by_slave(bond_dev, slave_dev); in bond_enslave()
1911 bond_ether_setup(bond_dev); in bond_enslave()
1914 bond_dev); in bond_enslave()
1916 } else if (bond_dev->type != slave_dev->type) { in bond_enslave()
1917 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
1924 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
1932 …slave_warn(bond_dev, slave_dev, "The slave device specified does not support setting the MAC addre… in bond_enslave()
1937 slave_warn(bond_dev, slave_dev, "Setting fail_over_mac to active for active-backup mode\n"); in bond_enslave()
1939 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
1974 slave_err(bond_dev, slave_dev, "Error %d calling dev_set_mtu\n", res); in bond_enslave()
1990 memcpy(ss.__data, bond_dev->dev_addr, bond_dev->addr_len); in bond_enslave()
1995 slave_err(bond_dev, slave_dev, "Error %d calling set_mac_address\n", res); in bond_enslave()
2006 slave_err(bond_dev, slave_dev, "Opening slave failed\n"); in bond_enslave()
2023 res = vlan_vids_add_by_dev(slave_dev, bond_dev); in bond_enslave()
2025 slave_err(bond_dev, slave_dev, "Couldn't add bond vlan ids\n"); in bond_enslave()
2057 …slave_warn(bond_dev, slave_dev, "MII and ETHTOOL support not available for slave, and arp_interval… in bond_enslave()
2060 …slave_warn(bond_dev, slave_dev, "can't get link status from slave; the network driver associated w… in bond_enslave()
2094 slave_dbg(bond_dev, slave_dev, "Initial state of slave is BOND_LINK_%s\n", in bond_enslave()
2137 slave_dbg(bond_dev, slave_dev, "This slave is always active in trunk mode\n"); in bond_enslave()
2156 …slave_info(bond_dev, slave_dev, "master_dev is using netpoll, but new slave device does not suppor… in bond_enslave()
2163 if (!(bond_dev->features & NETIF_F_LRO)) in bond_enslave()
2169 slave_dbg(bond_dev, slave_dev, "Error %d calling netdev_rx_handler_register\n", res); in bond_enslave()
2175 slave_dbg(bond_dev, slave_dev, "Error %d calling bond_master_upper_dev_link\n", res); in bond_enslave()
2183 slave_dbg(bond_dev, slave_dev, "Error %d calling bond_sysfs_slave_add\n", res); in bond_enslave()
2192 if (bond_dev->flags & IFF_PROMISC) { in bond_enslave()
2199 if (bond_dev->flags & IFF_ALLMULTI) { in bond_enslave()
2202 if (bond_dev->flags & IFF_PROMISC) in bond_enslave()
2208 if (bond_dev->flags & IFF_UP) { in bond_enslave()
2209 netif_addr_lock_bh(bond_dev); in bond_enslave()
2210 dev_mc_sync_multiple(slave_dev, bond_dev); in bond_enslave()
2211 dev_uc_sync_multiple(slave_dev, bond_dev); in bond_enslave()
2212 netif_addr_unlock_bh(bond_dev); in bond_enslave()
2236 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
2250 SLAVE_NL_ERR(bond_dev, slave_dev, extack, in bond_enslave()
2259 slave_dbg(bond_dev, slave_dev, "Error %d calling ndo_bpf\n", res); in bond_enslave()
2266 bond_xdp_set_features(bond_dev); in bond_enslave()
2268 slave_info(bond_dev, slave_dev, "Enslaving as %s interface with %s link\n", in bond_enslave()
2287 vlan_vids_del_by_dev(slave_dev, bond_dev); in bond_enslave()
2328 if (ether_addr_equal_64bits(bond_dev->dev_addr, in bond_enslave()
2330 eth_hw_addr_random(bond_dev); in bond_enslave()
2331 if (bond_dev->type != ARPHRD_ETHER) { in bond_enslave()
2332 dev_close(bond_dev); in bond_enslave()
2333 bond_ether_setup(bond_dev); in bond_enslave()
2351 static int __bond_release_one(struct net_device *bond_dev, in __bond_release_one() argument
2355 struct bonding *bond = netdev_priv(bond_dev); in __bond_release_one()
2358 int old_flags = bond_dev->flags; in __bond_release_one()
2359 netdev_features_t old_features = bond_dev->features; in __bond_release_one()
2363 !netdev_has_upper_dev(slave_dev, bond_dev)) { in __bond_release_one()
2364 slave_dbg(bond_dev, slave_dev, "cannot release slave\n"); in __bond_release_one()
2373 slave_info(bond_dev, slave_dev, "interface not enslaved\n"); in __bond_release_one()
2393 slave_warn(bond_dev, slave_dev, "failed to unload XDP program\n"); in __bond_release_one()
2409 slave_info(bond_dev, slave_dev, "Releasing %s interface\n", in __bond_release_one()
2418 if (ether_addr_equal_64bits(bond_dev->dev_addr, slave->perm_hwaddr) && in __bond_release_one()
2420 …slave_warn(bond_dev, slave_dev, "the permanent HWaddr of slave - %pM - is still in use by bond - s… in __bond_release_one()
2451 eth_hw_addr_random(bond_dev); in __bond_release_one()
2463 if (!(bond_dev->features & NETIF_F_VLAN_CHALLENGED) && in __bond_release_one()
2465 …slave_info(bond_dev, slave_dev, "last VLAN challenged slave left bond - VLAN blocking is removed\n… in __bond_release_one()
2467 vlan_vids_del_by_dev(slave_dev, bond_dev); in __bond_release_one()
2488 bond_hw_addr_flush(bond_dev, slave_dev); in __bond_release_one()
2515 bond_xdp_set_features(bond_dev); in __bond_release_one()
2522 int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) in bond_release() argument
2524 return __bond_release_one(bond_dev, slave_dev, false, false); in bond_release()
2530 static int bond_release_and_destroy(struct net_device *bond_dev, in bond_release_and_destroy() argument
2533 struct bonding *bond = netdev_priv(bond_dev); in bond_release_and_destroy()
2536 ret = __bond_release_one(bond_dev, slave_dev, false, true); in bond_release_and_destroy()
2538 bond_dev->reg_state != NETREG_UNREGISTERING) { in bond_release_and_destroy()
2539 bond_dev->priv_flags |= IFF_DISABLE_NETPOLL; in bond_release_and_destroy()
2540 netdev_info(bond_dev, "Destroying bond\n"); in bond_release_and_destroy()
2542 unregister_netdevice(bond_dev); in bond_release_and_destroy()
2547 static void bond_info_query(struct net_device *bond_dev, struct ifbond *info) in bond_info_query() argument
2549 struct bonding *bond = netdev_priv(bond_dev); in bond_info_query()
2554 static int bond_slave_info_query(struct net_device *bond_dev, struct ifslave *info) in bond_slave_info_query() argument
2556 struct bonding *bond = netdev_priv(bond_dev); in bond_slave_info_query()
2886 struct net_device *bond_dev = slave->bond->dev; in bond_handle_vlan() local
2902 slave_dbg(bond_dev, slave_dev, "inner tag: proto %X vid %X\n", in bond_handle_vlan()
2915 slave_dbg(bond_dev, slave_dev, "outer tag: proto %X vid %X\n", in bond_handle_vlan()
2931 struct net_device *bond_dev = slave->bond->dev; in bond_arp_send() local
2935 slave_dbg(bond_dev, slave_dev, "arp %d on slave: dst %pI4 src %pI4\n", in bond_arp_send()
3152 struct net_device *bond_dev = slave->bond->dev; in bond_ns_send() local
3157 slave_dbg(bond_dev, slave_dev, "NS on slave: dst %pI6c src %pI6c\n", in bond_ns_send()
3836 struct net_device *bond_dev) in bond_master_netdev_event() argument
3838 struct bonding *event_bond = netdev_priv(bond_dev); in bond_master_netdev_event()
3840 netdev_dbg(bond_dev, "%s called\n", __func__); in bond_master_netdev_event()
3848 xfrm_dev_state_flush(dev_net(bond_dev), bond_dev, true); in bond_master_netdev_event()
3866 struct net_device *bond_dev; in bond_slave_netdev_event() local
3877 bond_dev = slave->bond->dev; in bond_slave_netdev_event()
3881 slave_dbg(bond_dev, slave_dev, "%s called\n", __func__); in bond_slave_netdev_event()
3885 if (bond_dev->type != ARPHRD_ETHER) in bond_slave_netdev_event()
3886 bond_release_and_destroy(bond_dev, slave_dev); in bond_slave_netdev_event()
3888 __bond_release_one(bond_dev, slave_dev, false, true); in bond_slave_netdev_event()
3970 bond_xdp_set_features(bond_dev); in bond_slave_netdev_event()
4256 static int bond_open(struct net_device *bond_dev) in bond_open() argument
4258 struct bonding *bond = netdev_priv(bond_dev); in bond_open()
4316 static int bond_close(struct net_device *bond_dev) in bond_close() argument
4318 struct bonding *bond = netdev_priv(bond_dev); in bond_close()
4331 bond_hw_addr_flush(bond_dev, slave->dev); in bond_close()
4337 bond_hw_addr_flush(bond_dev, slave->dev); in bond_close()
4413 static void bond_get_stats(struct net_device *bond_dev, in bond_get_stats() argument
4416 struct bonding *bond = netdev_priv(bond_dev); in bond_get_stats()
4425 nest_level = bond_get_lowest_level_rcu(bond_dev); in bond_get_stats()
4446 static int bond_eth_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd) in bond_eth_ioctl() argument
4448 struct bonding *bond = netdev_priv(bond_dev); in bond_eth_ioctl()
4451 netdev_dbg(bond_dev, "bond_eth_ioctl: cmd=%d\n", cmd); in bond_eth_ioctl()
4483 static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd) in bond_do_ioctl() argument
4485 struct bonding *bond = netdev_priv(bond_dev); in bond_do_ioctl()
4495 netdev_dbg(bond_dev, "bond_ioctl: cmd=%d\n", cmd); in bond_do_ioctl()
4504 bond_info_query(bond_dev, &k_binfo); in bond_do_ioctl()
4515 res = bond_slave_info_query(bond_dev, &k_sinfo); in bond_do_ioctl()
4525 net = dev_net(bond_dev); in bond_do_ioctl()
4532 slave_dbg(bond_dev, slave_dev, "slave_dev=%p:\n", slave_dev); in bond_do_ioctl()
4539 res = bond_enslave(bond_dev, slave_dev, NULL); in bond_do_ioctl()
4542 res = bond_release(bond_dev, slave_dev); in bond_do_ioctl()
4545 res = bond_set_dev_addr(bond_dev, slave_dev); in bond_do_ioctl()
4559 static int bond_siocdevprivate(struct net_device *bond_dev, struct ifreq *ifr, in bond_siocdevprivate() argument
4566 return bond_do_ioctl(bond_dev, &ifrdata, SIOCBONDINFOQUERY); in bond_siocdevprivate()
4568 return bond_do_ioctl(bond_dev, &ifrdata, SIOCBONDSLAVEINFOQUERY); in bond_siocdevprivate()
4570 return bond_do_ioctl(bond_dev, ifr, SIOCBONDENSLAVE); in bond_siocdevprivate()
4572 return bond_do_ioctl(bond_dev, ifr, SIOCBONDRELEASE); in bond_siocdevprivate()
4574 return bond_do_ioctl(bond_dev, ifr, SIOCBONDSETHWADDR); in bond_siocdevprivate()
4576 return bond_do_ioctl(bond_dev, ifr, SIOCBONDCHANGEACTIVE); in bond_siocdevprivate()
4582 static void bond_change_rx_flags(struct net_device *bond_dev, int change) in bond_change_rx_flags() argument
4584 struct bonding *bond = netdev_priv(bond_dev); in bond_change_rx_flags()
4588 bond_dev->flags & IFF_PROMISC ? 1 : -1); in bond_change_rx_flags()
4592 bond_dev->flags & IFF_ALLMULTI ? 1 : -1); in bond_change_rx_flags()
4595 static void bond_set_rx_mode(struct net_device *bond_dev) in bond_set_rx_mode() argument
4597 struct bonding *bond = netdev_priv(bond_dev); in bond_set_rx_mode()
4605 dev_uc_sync(slave->dev, bond_dev); in bond_set_rx_mode()
4606 dev_mc_sync(slave->dev, bond_dev); in bond_set_rx_mode()
4610 dev_uc_sync_multiple(slave->dev, bond_dev); in bond_set_rx_mode()
4611 dev_mc_sync_multiple(slave->dev, bond_dev); in bond_set_rx_mode()
4673 static int bond_change_mtu(struct net_device *bond_dev, int new_mtu) in bond_change_mtu() argument
4675 struct bonding *bond = netdev_priv(bond_dev); in bond_change_mtu()
4680 netdev_dbg(bond_dev, "bond=%p, new_mtu=%d\n", bond, new_mtu); in bond_change_mtu()
4683 slave_dbg(bond_dev, slave->dev, "s %p c_m %p\n", in bond_change_mtu()
4697 slave_dbg(bond_dev, slave->dev, "err %d setting mtu to %d\n", in bond_change_mtu()
4703 bond_dev->mtu = new_mtu; in bond_change_mtu()
4715 tmp_res = dev_set_mtu(rollback_slave->dev, bond_dev->mtu); in bond_change_mtu()
4717 slave_dbg(bond_dev, rollback_slave->dev, "unwind err %d\n", in bond_change_mtu()
4730 static int bond_set_mac_address(struct net_device *bond_dev, void *addr) in bond_set_mac_address() argument
4732 struct bonding *bond = netdev_priv(bond_dev); in bond_set_mac_address()
4739 return bond_alb_set_mac_address(bond_dev, addr); in bond_set_mac_address()
4742 netdev_dbg(bond_dev, "%s: bond=%p\n", __func__, bond); in bond_set_mac_address()
4755 slave_dbg(bond_dev, slave->dev, "%s: slave=%p\n", in bond_set_mac_address()
4765 slave_dbg(bond_dev, slave->dev, "%s: err %d\n", in bond_set_mac_address()
4772 dev_addr_set(bond_dev, ss->__data); in bond_set_mac_address()
4776 memcpy(tmp_ss.__data, bond_dev->dev_addr, bond_dev->addr_len); in bond_set_mac_address()
4777 tmp_ss.ss_family = bond_dev->type; in bond_set_mac_address()
4789 slave_dbg(bond_dev, rollback_slave->dev, "%s: unwind err %d\n", in bond_set_mac_address()
4945 struct net_device *bond_dev) in bond_xmit_roundrobin() argument
4947 struct bonding *bond = netdev_priv(bond_dev); in bond_xmit_roundrobin()
4954 return bond_tx_drop(bond_dev, skb); in bond_xmit_roundrobin()
4966 struct net_device *bond_dev) in bond_xmit_activebackup() argument
4968 struct bonding *bond = netdev_priv(bond_dev); in bond_xmit_activebackup()
4975 return bond_tx_drop(bond_dev, skb); in bond_xmit_activebackup()
5184 struct net_device *bond_dev) in bond_xmit_broadcast() argument
5186 struct bonding *bond = netdev_priv(bond_dev); in bond_xmit_broadcast()
5205 bond_dev->name, __func__); in bond_xmit_broadcast()
5220 dev_core_stats_tx_dropped_inc(bond_dev); in bond_xmit_broadcast()
5468 bond_xdp_get_xmit_slave(struct net_device *bond_dev, struct xdp_buff *xdp) in bond_xdp_get_xmit_slave() argument
5470 struct bonding *bond = netdev_priv(bond_dev); in bond_xdp_get_xmit_slave()
5491 netdev_err(bond_dev, "Unknown bonding mode %d for xdp xmit\n", BOND_MODE(bond)); in bond_xdp_get_xmit_slave()
5502 static int bond_xdp_xmit(struct net_device *bond_dev, in bond_xdp_xmit() argument
5517 slave_dev = bond_xdp_get_xmit_slave(bond_dev, &xdp); in bond_xdp_xmit()
5703 static int bond_ethtool_get_link_ksettings(struct net_device *bond_dev, in bond_ethtool_get_link_ksettings() argument
5706 struct bonding *bond = netdev_priv(bond_dev); in bond_ethtool_get_link_ksettings()
5739 static void bond_ethtool_get_drvinfo(struct net_device *bond_dev, in bond_ethtool_get_drvinfo() argument
5747 static int bond_ethtool_get_ts_info(struct net_device *bond_dev, in bond_ethtool_get_ts_info() argument
5750 struct bonding *bond = netdev_priv(bond_dev); in bond_ethtool_get_ts_info()
5860 static void bond_destructor(struct net_device *bond_dev) in bond_destructor() argument
5862 struct bonding *bond = netdev_priv(bond_dev); in bond_destructor()
5870 void bond_setup(struct net_device *bond_dev) in bond_setup() argument
5872 struct bonding *bond = netdev_priv(bond_dev); in bond_setup()
5878 bond->dev = bond_dev; in bond_setup()
5881 ether_setup(bond_dev); in bond_setup()
5882 bond_dev->max_mtu = ETH_MAX_MTU; in bond_setup()
5883 bond_dev->netdev_ops = &bond_netdev_ops; in bond_setup()
5884 bond_dev->ethtool_ops = &bond_ethtool_ops; in bond_setup()
5886 bond_dev->needs_free_netdev = true; in bond_setup()
5887 bond_dev->priv_destructor = bond_destructor; in bond_setup()
5889 SET_NETDEV_DEVTYPE(bond_dev, &bond_type); in bond_setup()
5892 bond_dev->flags |= IFF_MASTER; in bond_setup()
5893 bond_dev->priv_flags |= IFF_BONDING | IFF_UNICAST_FLT | IFF_NO_QUEUE; in bond_setup()
5894 bond_dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING); in bond_setup()
5898 bond_dev->xfrmdev_ops = &bond_xfrmdev_ops; in bond_setup()
5904 bond_dev->features |= NETIF_F_LLTX; in bond_setup()
5914 bond_dev->features |= NETIF_F_NETNS_LOCAL; in bond_setup()
5916 bond_dev->hw_features = BOND_VLAN_FEATURES | in bond_setup()
5922 bond_dev->hw_features |= NETIF_F_GSO_ENCAP_ALL; in bond_setup()
5923 bond_dev->features |= bond_dev->hw_features; in bond_setup()
5924 bond_dev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX; in bond_setup()
5926 bond_dev->hw_features |= BOND_XFRM_FEATURES; in bond_setup()
5929 bond_dev->features |= BOND_XFRM_FEATURES; in bond_setup()
5933 bond_dev->xdp_features = NETDEV_XDP_ACT_MASK; in bond_setup()
5939 static void bond_uninit(struct net_device *bond_dev) in bond_uninit() argument
5941 struct bonding *bond = netdev_priv(bond_dev); in bond_uninit()
5945 bond_netpoll_cleanup(bond_dev); in bond_uninit()
5949 __bond_release_one(bond_dev, slave->dev, true, true); in bond_uninit()
5950 netdev_info(bond_dev, "Released all slaves\n"); in bond_uninit()
6351 static int bond_init(struct net_device *bond_dev) in bond_init() argument
6353 struct bonding *bond = netdev_priv(bond_dev); in bond_init()
6354 struct bond_net *bn = net_generic(dev_net(bond_dev), bond_net_id); in bond_init()
6356 netdev_dbg(bond_dev, "Begin bond_init\n"); in bond_init()
6358 bond->wq = alloc_ordered_workqueue(bond_dev->name, WQ_MEM_RECLAIM); in bond_init()
6365 netdev_lockdep_set_classes(bond_dev); in bond_init()
6374 if (is_zero_ether_addr(bond_dev->dev_addr) && in bond_init()
6375 bond_dev->addr_assign_type == NET_ADDR_PERM) in bond_init()
6376 eth_hw_addr_random(bond_dev); in bond_init()
6393 struct net_device *bond_dev; in bond_create() local
6399 bond_dev = alloc_netdev_mq(sizeof(struct bonding), in bond_create()
6402 if (!bond_dev) in bond_create()
6405 bond = netdev_priv(bond_dev); in bond_create()
6406 dev_net_set(bond_dev, net); in bond_create()
6407 bond_dev->rtnl_link_ops = &bond_link_ops; in bond_create()
6409 res = register_netdevice(bond_dev); in bond_create()
6411 free_netdev(bond_dev); in bond_create()
6415 netif_carrier_off(bond_dev); in bond_create()