Lines Matching full:peer
20 struct net_device __rcu *peer; member
86 struct net_device *peer; in netkit_xmit() local
91 peer = rcu_dereference(nk->peer); in netkit_xmit()
92 if (unlikely(!peer || !(peer->flags & IFF_UP) || in netkit_xmit()
96 netkit_prep_forward(skb, !net_eq(dev_net(dev), dev_net(peer)), in netkit_xmit()
98 eth_skb_pkt_type(skb, peer); in netkit_xmit()
99 skb->dev = peer; in netkit_xmit()
110 dev_sw_netstats_rx_add(peer, len); in netkit_xmit()
136 struct net_device *peer = rtnl_dereference(nk->peer); in netkit_open() local
138 if (!peer) in netkit_open()
140 if (peer->flags & IFF_UP) { in netkit_open()
142 netif_carrier_on(peer); in netkit_open()
150 struct net_device *peer = rtnl_dereference(nk->peer); in netkit_close() local
153 if (peer) in netkit_close()
154 netif_carrier_off(peer); in netkit_close()
161 struct net_device *peer; in netkit_get_iflink() local
165 peer = rcu_dereference(nk->peer); in netkit_get_iflink()
166 if (peer) in netkit_get_iflink()
167 iflink = READ_ONCE(peer->ifindex); in netkit_get_iflink()
190 struct net_device *peer; in netkit_set_headroom() local
196 peer = rcu_dereference(nk->peer); in netkit_set_headroom()
197 if (unlikely(!peer)) in netkit_set_headroom()
200 nk2 = netkit_priv(peer); in netkit_set_headroom()
204 peer->needed_headroom = headroom; in netkit_set_headroom()
212 return rcu_dereference(netkit_priv(dev)->peer); in netkit_peer_dev()
295 struct net_device *peer = rtnl_dereference(nk->peer); in netkit_get_link_net() local
297 return peer ? dev_net(peer) : dev_net(dev); in netkit_get_link_net()
342 struct net_device *peer; in netkit_new_link() local
387 peer = rtnl_create_link(peer_net, ifname, ifname_assign_type, in netkit_new_link()
389 if (IS_ERR(peer)) in netkit_new_link()
390 return PTR_ERR(peer); in netkit_new_link()
392 netif_inherit_tso_max(peer, dev); in netkit_new_link()
395 eth_hw_addr_random(peer); in netkit_new_link()
397 peer->ifindex = ifmp->ifi_index; in netkit_new_link()
399 nk = netkit_priv(peer); in netkit_new_link()
406 err = register_netdevice(peer); in netkit_new_link()
409 netif_carrier_off(peer); in netkit_new_link()
411 dev_change_flags(peer, peer->flags & ~IFF_NOARP, NULL); in netkit_new_link()
413 err = rtnl_configure_link(peer, NULL, 0, NULL); in netkit_new_link()
438 rcu_assign_pointer(netkit_priv(dev)->peer, peer); in netkit_new_link()
439 rcu_assign_pointer(netkit_priv(peer)->peer, dev); in netkit_new_link()
442 unregister_netdevice(peer); in netkit_new_link()
445 free_netdev(peer); in netkit_new_link()
503 dev = rcu_dereference_rtnl(nk->peer); in netkit_dev_fetch()
719 nkl->location == BPF_NETKIT_PRIMARY ? "primary" : "peer"); in netkit_link_fdinfo()
834 struct net_device *peer = rtnl_dereference(nk->peer); in netkit_del_link() local
836 RCU_INIT_POINTER(nk->peer, NULL); in netkit_del_link()
838 if (peer) { in netkit_del_link()
839 nk = netkit_priv(peer); in netkit_del_link()
840 RCU_INIT_POINTER(nk->peer, NULL); in netkit_del_link()
841 unregister_netdevice_queue(peer, head); in netkit_del_link()
850 struct net_device *peer = rtnl_dereference(nk->peer); in netkit_change_link() local
881 "netkit peer info cannot be changed after device creation"); in netkit_change_link()
898 if (peer) in netkit_change_link()
902 nk = netkit_priv(peer); in netkit_change_link()
923 struct net_device *peer = rtnl_dereference(nk->peer); in netkit_fill_info() local
934 if (peer) { in netkit_fill_info()
935 nk = netkit_priv(peer); in netkit_fill_info()