Lines Matching refs:vf_netdev

64 	struct net_device *vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev);  in netvsc_change_rx_flags()  local
67 if (!vf_netdev) in netvsc_change_rx_flags()
72 dev_set_promiscuity(vf_netdev, inc); in netvsc_change_rx_flags()
77 dev_set_allmulti(vf_netdev, inc); in netvsc_change_rx_flags()
84 struct net_device *vf_netdev; in netvsc_set_rx_mode() local
88 vf_netdev = rcu_dereference(ndev_ctx->vf_netdev); in netvsc_set_rx_mode()
89 if (vf_netdev) { in netvsc_set_rx_mode()
90 dev_uc_sync(vf_netdev, net); in netvsc_set_rx_mode()
91 dev_mc_sync(vf_netdev, net); in netvsc_set_rx_mode()
112 struct net_device *vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev); in netvsc_open() local
132 if (vf_netdev) { in netvsc_open()
137 ret = dev_open(vf_netdev, NULL); in netvsc_open()
141 vf_netdev->name, ret); in netvsc_open()
198 struct net_device *vf_netdev in netvsc_close() local
199 = rtnl_dereference(net_device_ctx->vf_netdev); in netvsc_close()
219 if (vf_netdev) in netvsc_close()
220 dev_close(vf_netdev); in netvsc_close()
295 struct net_device *vf_netdev; in netvsc_select_queue() local
299 vf_netdev = rcu_dereference(ndc->vf_netdev); in netvsc_select_queue()
300 if (vf_netdev) { in netvsc_select_queue()
301 const struct net_device_ops *vf_ops = vf_netdev->netdev_ops; in netvsc_select_queue()
304 txq = vf_ops->ndo_select_queue(vf_netdev, skb, sb_dev); in netvsc_select_queue()
306 txq = netdev_pick_tx(vf_netdev, skb, NULL); in netvsc_select_queue()
445 static int netvsc_vf_xmit(struct net_device *net, struct net_device *vf_netdev, in netvsc_vf_xmit() argument
452 skb->dev = vf_netdev; in netvsc_vf_xmit()
478 struct net_device *vf_netdev; in netvsc_xmit() local
487 vf_netdev = rcu_dereference_bh(net_device_ctx->vf_netdev); in netvsc_xmit()
488 if (vf_netdev && netif_running(vf_netdev) && in netvsc_xmit()
489 netif_carrier_ok(vf_netdev) && !netpoll_tx_running(net) && in netvsc_xmit()
491 return netvsc_vf_xmit(net, vf_netdev, skb); in netvsc_xmit()
1172 struct net_device *vf_netdev; in netvsc_get_link_ksettings() local
1174 vf_netdev = rtnl_dereference(ndc->vf_netdev); in netvsc_get_link_ksettings()
1176 if (vf_netdev) in netvsc_get_link_ksettings()
1177 return __ethtool_get_link_ksettings(vf_netdev, cmd); in netvsc_get_link_ksettings()
1190 struct net_device *vf_netdev = rtnl_dereference(ndc->vf_netdev); in netvsc_set_link_ksettings() local
1192 if (vf_netdev) { in netvsc_set_link_ksettings()
1193 if (!vf_netdev->ethtool_ops->set_link_ksettings) in netvsc_set_link_ksettings()
1196 return vf_netdev->ethtool_ops->set_link_ksettings(vf_netdev, in netvsc_set_link_ksettings()
1207 struct net_device *vf_netdev = rtnl_dereference(ndevctx->vf_netdev); in netvsc_change_mtu() local
1222 if (vf_netdev) { in netvsc_change_mtu()
1223 ret = dev_set_mtu(vf_netdev, mtu); in netvsc_change_mtu()
1244 if (vf_netdev) in netvsc_change_mtu()
1245 dev_set_mtu(vf_netdev, orig_mtu); in netvsc_change_mtu()
1400 struct net_device *vf_netdev = rtnl_dereference(ndc->vf_netdev); in netvsc_set_mac_addr() local
1412 if (vf_netdev) { in netvsc_set_mac_addr()
1413 err = dev_set_mac_address(vf_netdev, addr, NULL); in netvsc_set_mac_addr()
1421 } else if (vf_netdev) { in netvsc_set_mac_addr()
1424 dev_set_mac_address(vf_netdev, addr, NULL); in netvsc_set_mac_addr()
1924 struct net_device *vf_netdev = rtnl_dereference(ndevctx->vf_netdev); in netvsc_set_features() local
1952 if (!vf_netdev) in netvsc_set_features()
1955 vf_netdev->wanted_features = features; in netvsc_set_features()
1956 netdev_update_features(vf_netdev); in netvsc_set_features()
2139 static struct net_device *get_netvsc_byref(struct net_device *vf_netdev) in get_netvsc_byref() argument
2144 dev = netdev_master_upper_dev_get(vf_netdev); in get_netvsc_byref()
2183 static int netvsc_vf_join(struct net_device *vf_netdev, in netvsc_vf_join() argument
2189 ret = netdev_rx_handler_register(vf_netdev, in netvsc_vf_join()
2192 netdev_err(vf_netdev, in netvsc_vf_join()
2198 ret = netdev_master_upper_dev_link(vf_netdev, ndev, in netvsc_vf_join()
2201 netdev_err(vf_netdev, in netvsc_vf_join()
2208 vf_netdev->flags |= IFF_SLAVE; in netvsc_vf_join()
2212 call_netdevice_notifiers(NETDEV_JOIN, vf_netdev); in netvsc_vf_join()
2214 netdev_info(vf_netdev, "joined to %s\n", ndev->name); in netvsc_vf_join()
2218 netdev_rx_handler_unregister(vf_netdev); in netvsc_vf_join()
2224 struct net_device *vf_netdev) in __netvsc_vf_setup() argument
2229 ret = dev_set_mtu(vf_netdev, ndev->mtu); in __netvsc_vf_setup()
2231 netdev_warn(vf_netdev, in __netvsc_vf_setup()
2235 dev_change_flags(vf_netdev, ndev->flags | IFF_SLAVE, NULL); in __netvsc_vf_setup()
2239 dev_uc_sync(vf_netdev, ndev); in __netvsc_vf_setup()
2240 dev_mc_sync(vf_netdev, ndev); in __netvsc_vf_setup()
2244 ret = dev_open(vf_netdev, NULL); in __netvsc_vf_setup()
2246 netdev_warn(vf_netdev, in __netvsc_vf_setup()
2259 struct net_device *vf_netdev; in netvsc_vf_setup() local
2266 vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev); in netvsc_vf_setup()
2267 if (vf_netdev) in netvsc_vf_setup()
2268 __netvsc_vf_setup(ndev, vf_netdev); in netvsc_vf_setup()
2276 static struct net_device *get_netvsc_byslot(const struct net_device *vf_netdev) in get_netvsc_byslot() argument
2278 struct device *parent = vf_netdev->dev.parent; in get_netvsc_byslot()
2289 netdev_notice(vf_netdev, "no PCI slot information\n"); in get_netvsc_byslot()
2294 netdev_notice(vf_netdev, "Invalid vf serial:%s\n", in get_netvsc_byslot()
2307 if (ndev->addr_len != vf_netdev->addr_len || in get_netvsc_byslot()
2308 memcmp(ndev->perm_addr, vf_netdev->perm_addr, in get_netvsc_byslot()
2321 if (ether_addr_equal(vf_netdev->perm_addr, ndev->perm_addr)) { in get_netvsc_byslot()
2322 netdev_notice(vf_netdev, in get_netvsc_byslot()
2328 netdev_notice(vf_netdev, in get_netvsc_byslot()
2333 static int netvsc_register_vf(struct net_device *vf_netdev) in netvsc_register_vf() argument
2341 if (vf_netdev->addr_len != ETH_ALEN) in netvsc_register_vf()
2344 ndev = get_netvsc_byslot(vf_netdev); in netvsc_register_vf()
2350 if (!netvsc_dev || rtnl_dereference(net_device_ctx->vf_netdev)) in netvsc_register_vf()
2357 if (!net_eq(dev_net(ndev), dev_net(vf_netdev))) { in netvsc_register_vf()
2358 ret = dev_change_net_namespace(vf_netdev, in netvsc_register_vf()
2361 netdev_err(vf_netdev, in netvsc_register_vf()
2365 netdev_info(vf_netdev, in netvsc_register_vf()
2371 netdev_info(ndev, "VF registering: %s\n", vf_netdev->name); in netvsc_register_vf()
2373 if (netvsc_vf_join(vf_netdev, ndev) != 0) in netvsc_register_vf()
2376 dev_hold(vf_netdev); in netvsc_register_vf()
2377 rcu_assign_pointer(net_device_ctx->vf_netdev, vf_netdev); in netvsc_register_vf()
2379 if (ndev->needed_headroom < vf_netdev->needed_headroom) in netvsc_register_vf()
2380 ndev->needed_headroom = vf_netdev->needed_headroom; in netvsc_register_vf()
2382 vf_netdev->wanted_features = ndev->features; in netvsc_register_vf()
2383 netdev_update_features(vf_netdev); in netvsc_register_vf()
2386 netvsc_vf_setxdp(vf_netdev, prog); in netvsc_register_vf()
2401 static int netvsc_vf_changed(struct net_device *vf_netdev, unsigned long event) in netvsc_vf_changed() argument
2410 vf_is_up = netif_running(vf_netdev); in netvsc_vf_changed()
2412 ndev = get_netvsc_byref(vf_netdev); in netvsc_vf_changed()
2434 vf_is_up ? "to" : "from", vf_netdev->name, ret); in netvsc_vf_changed()
2438 vf_is_up ? "to" : "from", vf_netdev->name); in netvsc_vf_changed()
2444 static int netvsc_unregister_vf(struct net_device *vf_netdev) in netvsc_unregister_vf() argument
2449 ndev = get_netvsc_byref(vf_netdev); in netvsc_unregister_vf()
2456 netdev_info(ndev, "VF unregistering: %s\n", vf_netdev->name); in netvsc_unregister_vf()
2458 netvsc_vf_setxdp(vf_netdev, NULL); in netvsc_unregister_vf()
2461 netdev_rx_handler_unregister(vf_netdev); in netvsc_unregister_vf()
2462 netdev_upper_dev_unlink(vf_netdev, ndev); in netvsc_unregister_vf()
2463 RCU_INIT_POINTER(net_device_ctx->vf_netdev, NULL); in netvsc_unregister_vf()
2464 dev_put(vf_netdev); in netvsc_unregister_vf()
2600 struct net_device *vf_netdev, *net; in netvsc_remove() local
2624 vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev); in netvsc_remove()
2625 if (vf_netdev) in netvsc_remove()
2626 netvsc_unregister_vf(vf_netdev); in netvsc_remove()