Lines Matching refs:vf_netdev

65 	struct net_device *vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev);  in netvsc_change_rx_flags()  local
68 if (!vf_netdev) in netvsc_change_rx_flags()
73 dev_set_promiscuity(vf_netdev, inc); in netvsc_change_rx_flags()
78 dev_set_allmulti(vf_netdev, inc); in netvsc_change_rx_flags()
85 struct net_device *vf_netdev; in netvsc_set_rx_mode() local
89 vf_netdev = rcu_dereference(ndev_ctx->vf_netdev); in netvsc_set_rx_mode()
90 if (vf_netdev) { in netvsc_set_rx_mode()
91 dev_uc_sync(vf_netdev, net); in netvsc_set_rx_mode()
92 dev_mc_sync(vf_netdev, net); in netvsc_set_rx_mode()
113 struct net_device *vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev); in netvsc_open() local
133 if (vf_netdev) { in netvsc_open()
138 ret = dev_open(vf_netdev, NULL); in netvsc_open()
142 vf_netdev->name, ret); in netvsc_open()
199 struct net_device *vf_netdev in netvsc_close() local
200 = rtnl_dereference(net_device_ctx->vf_netdev); in netvsc_close()
220 if (vf_netdev) in netvsc_close()
221 dev_close(vf_netdev); in netvsc_close()
346 struct net_device *vf_netdev; in netvsc_select_queue() local
350 vf_netdev = rcu_dereference(ndc->vf_netdev); in netvsc_select_queue()
351 if (vf_netdev) { in netvsc_select_queue()
352 const struct net_device_ops *vf_ops = vf_netdev->netdev_ops; in netvsc_select_queue()
355 txq = vf_ops->ndo_select_queue(vf_netdev, skb, sb_dev); in netvsc_select_queue()
357 txq = netdev_pick_tx(vf_netdev, skb, NULL); in netvsc_select_queue()
496 static int netvsc_vf_xmit(struct net_device *net, struct net_device *vf_netdev, in netvsc_vf_xmit() argument
503 skb->dev = vf_netdev; in netvsc_vf_xmit()
529 struct net_device *vf_netdev; in netvsc_start_xmit() local
537 vf_netdev = rcu_dereference_bh(net_device_ctx->vf_netdev); in netvsc_start_xmit()
538 if (vf_netdev && netif_running(vf_netdev) && in netvsc_start_xmit()
540 return netvsc_vf_xmit(net, vf_netdev, skb); in netvsc_start_xmit()
1112 struct net_device *vf_netdev = rtnl_dereference(ndevctx->vf_netdev); in netvsc_change_mtu() local
1127 if (vf_netdev) { in netvsc_change_mtu()
1128 ret = dev_set_mtu(vf_netdev, mtu); in netvsc_change_mtu()
1149 if (vf_netdev) in netvsc_change_mtu()
1150 dev_set_mtu(vf_netdev, orig_mtu); in netvsc_change_mtu()
1303 struct net_device *vf_netdev = rtnl_dereference(ndc->vf_netdev); in netvsc_set_mac_addr() local
1315 if (vf_netdev) { in netvsc_set_mac_addr()
1316 err = dev_set_mac_address(vf_netdev, addr, NULL); in netvsc_set_mac_addr()
1324 } else if (vf_netdev) { in netvsc_set_mac_addr()
1327 dev_set_mac_address(vf_netdev, addr, NULL); in netvsc_set_mac_addr()
1795 struct net_device *vf_netdev = rtnl_dereference(ndevctx->vf_netdev); in netvsc_set_features() local
1823 if (!vf_netdev) in netvsc_set_features()
1826 vf_netdev->wanted_features = features; in netvsc_set_features()
1827 netdev_update_features(vf_netdev); in netvsc_set_features()
1991 static struct net_device *get_netvsc_byref(struct net_device *vf_netdev) in get_netvsc_byref() argument
1996 dev = netdev_master_upper_dev_get(vf_netdev); in get_netvsc_byref()
2035 static int netvsc_vf_join(struct net_device *vf_netdev, in netvsc_vf_join() argument
2041 ret = netdev_rx_handler_register(vf_netdev, in netvsc_vf_join()
2044 netdev_err(vf_netdev, in netvsc_vf_join()
2050 ret = netdev_master_upper_dev_link(vf_netdev, ndev, in netvsc_vf_join()
2053 netdev_err(vf_netdev, in netvsc_vf_join()
2060 vf_netdev->flags |= IFF_SLAVE; in netvsc_vf_join()
2064 call_netdevice_notifiers(NETDEV_JOIN, vf_netdev); in netvsc_vf_join()
2066 netdev_info(vf_netdev, "joined to %s\n", ndev->name); in netvsc_vf_join()
2070 netdev_rx_handler_unregister(vf_netdev); in netvsc_vf_join()
2076 struct net_device *vf_netdev) in __netvsc_vf_setup() argument
2081 ret = dev_set_mtu(vf_netdev, ndev->mtu); in __netvsc_vf_setup()
2083 netdev_warn(vf_netdev, in __netvsc_vf_setup()
2087 dev_change_flags(vf_netdev, ndev->flags | IFF_SLAVE, NULL); in __netvsc_vf_setup()
2091 dev_uc_sync(vf_netdev, ndev); in __netvsc_vf_setup()
2092 dev_mc_sync(vf_netdev, ndev); in __netvsc_vf_setup()
2096 ret = dev_open(vf_netdev, NULL); in __netvsc_vf_setup()
2098 netdev_warn(vf_netdev, in __netvsc_vf_setup()
2111 struct net_device *vf_netdev; in netvsc_vf_setup() local
2118 vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev); in netvsc_vf_setup()
2119 if (vf_netdev) in netvsc_vf_setup()
2120 __netvsc_vf_setup(ndev, vf_netdev); in netvsc_vf_setup()
2128 static struct net_device *get_netvsc_byslot(const struct net_device *vf_netdev) in get_netvsc_byslot() argument
2130 struct device *parent = vf_netdev->dev.parent; in get_netvsc_byslot()
2140 netdev_notice(vf_netdev, "no PCI slot information\n"); in get_netvsc_byslot()
2145 netdev_notice(vf_netdev, "Invalid vf serial:%s\n", in get_netvsc_byslot()
2158 netdev_notice(vf_netdev, in get_netvsc_byslot()
2163 static int netvsc_register_vf(struct net_device *vf_netdev) in netvsc_register_vf() argument
2170 if (vf_netdev->addr_len != ETH_ALEN) in netvsc_register_vf()
2173 ndev = get_netvsc_byslot(vf_netdev); in netvsc_register_vf()
2179 if (!netvsc_dev || rtnl_dereference(net_device_ctx->vf_netdev)) in netvsc_register_vf()
2186 if (!net_eq(dev_net(ndev), dev_net(vf_netdev))) { in netvsc_register_vf()
2187 ret = dev_change_net_namespace(vf_netdev, in netvsc_register_vf()
2190 netdev_err(vf_netdev, in netvsc_register_vf()
2194 netdev_info(vf_netdev, in netvsc_register_vf()
2200 netdev_info(ndev, "VF registering: %s\n", vf_netdev->name); in netvsc_register_vf()
2202 if (netvsc_vf_join(vf_netdev, ndev) != 0) in netvsc_register_vf()
2205 dev_hold(vf_netdev); in netvsc_register_vf()
2206 rcu_assign_pointer(net_device_ctx->vf_netdev, vf_netdev); in netvsc_register_vf()
2208 vf_netdev->wanted_features = ndev->features; in netvsc_register_vf()
2209 netdev_update_features(vf_netdev); in netvsc_register_vf()
2215 static int netvsc_vf_changed(struct net_device *vf_netdev) in netvsc_vf_changed() argument
2220 bool vf_is_up = netif_running(vf_netdev); in netvsc_vf_changed()
2222 ndev = get_netvsc_byref(vf_netdev); in netvsc_vf_changed()
2233 vf_is_up ? "to" : "from", vf_netdev->name); in netvsc_vf_changed()
2238 static int netvsc_unregister_vf(struct net_device *vf_netdev) in netvsc_unregister_vf() argument
2243 ndev = get_netvsc_byref(vf_netdev); in netvsc_unregister_vf()
2250 netdev_info(ndev, "VF unregistering: %s\n", vf_netdev->name); in netvsc_unregister_vf()
2252 netdev_rx_handler_unregister(vf_netdev); in netvsc_unregister_vf()
2253 netdev_upper_dev_unlink(vf_netdev, ndev); in netvsc_unregister_vf()
2254 RCU_INIT_POINTER(net_device_ctx->vf_netdev, NULL); in netvsc_unregister_vf()
2255 dev_put(vf_netdev); in netvsc_unregister_vf()
2383 struct net_device *vf_netdev, *net; in netvsc_remove() local
2405 vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev); in netvsc_remove()
2406 if (vf_netdev) in netvsc_remove()
2407 netvsc_unregister_vf(vf_netdev); in netvsc_remove()