Lines Matching refs:nk
69 struct netkit *nk = netkit_priv(dev); in netkit_xmit() local
70 enum netkit_action ret = READ_ONCE(nk->policy); in netkit_xmit()
78 peer = rcu_dereference(nk->peer); in netkit_xmit()
86 entry = rcu_dereference(nk->active); in netkit_xmit()
121 struct netkit *nk = netkit_priv(dev); in netkit_open() local
122 struct net_device *peer = rtnl_dereference(nk->peer); in netkit_open()
135 struct netkit *nk = netkit_priv(dev); in netkit_close() local
136 struct net_device *peer = rtnl_dereference(nk->peer); in netkit_close()
146 struct netkit *nk = netkit_priv(dev); in netkit_get_iflink() local
151 peer = rcu_dereference(nk->peer); in netkit_get_iflink()
165 struct netkit *nk = netkit_priv(dev); in netkit_set_macaddr() local
167 if (nk->mode != NETKIT_L2) in netkit_set_macaddr()
175 struct netkit *nk = netkit_priv(dev), *nk2; in netkit_set_headroom() local
182 peer = rcu_dereference(nk->peer); in netkit_set_headroom()
187 nk->headroom = headroom; in netkit_set_headroom()
188 headroom = max(nk->headroom, nk2->headroom); in netkit_set_headroom()
280 struct netkit *nk = netkit_priv(dev); in netkit_get_link_net() local
281 struct net_device *peer = rtnl_dereference(nk->peer); in netkit_get_link_net()
342 struct netkit *nk; in netkit_new_link() local
410 nk = netkit_priv(peer); in netkit_new_link()
411 nk->primary = false; in netkit_new_link()
412 nk->policy = default_peer; in netkit_new_link()
413 nk->mode = mode; in netkit_new_link()
414 bpf_mprog_bundle_init(&nk->bundle); in netkit_new_link()
435 nk = netkit_priv(dev); in netkit_new_link()
436 nk->primary = true; in netkit_new_link()
437 nk->policy = default_prim; in netkit_new_link()
438 nk->mode = mode; in netkit_new_link()
439 bpf_mprog_bundle_init(&nk->bundle); in netkit_new_link()
462 struct netkit *nk = netkit_priv(dev); in netkit_entry_fetch() local
466 entry = rcu_dereference_rtnl(nk->active); in netkit_entry_fetch()
470 return &nk->bundle.a; in netkit_entry_fetch()
477 struct netkit *nk = netkit_priv(dev); in netkit_entry_update() local
480 rcu_assign_pointer(nk->active, entry); in netkit_entry_update()
491 struct netkit *nk; in netkit_dev_fetch() local
509 nk = netkit_priv(dev); in netkit_dev_fetch()
510 if (!nk->primary) in netkit_dev_fetch()
513 dev = rcu_dereference_rtnl(nk->peer); in netkit_dev_fetch()
843 struct netkit *nk = netkit_priv(dev); in netkit_del_link() local
844 struct net_device *peer = rtnl_dereference(nk->peer); in netkit_del_link()
846 RCU_INIT_POINTER(nk->peer, NULL); in netkit_del_link()
849 nk = netkit_priv(peer); in netkit_del_link()
850 RCU_INIT_POINTER(nk->peer, NULL); in netkit_del_link()
859 struct netkit *nk = netkit_priv(dev); in netkit_change_link() local
860 struct net_device *peer = rtnl_dereference(nk->peer); in netkit_change_link()
865 if (!nk->primary) { in netkit_change_link()
889 WRITE_ONCE(nk->policy, policy); in netkit_change_link()
900 nk = netkit_priv(peer); in netkit_change_link()
901 WRITE_ONCE(nk->policy, policy); in netkit_change_link()
918 struct netkit *nk = netkit_priv(dev); in netkit_fill_info() local
919 struct net_device *peer = rtnl_dereference(nk->peer); in netkit_fill_info()
921 if (nla_put_u8(skb, IFLA_NETKIT_PRIMARY, nk->primary)) in netkit_fill_info()
923 if (nla_put_u32(skb, IFLA_NETKIT_POLICY, nk->policy)) in netkit_fill_info()
925 if (nla_put_u32(skb, IFLA_NETKIT_MODE, nk->mode)) in netkit_fill_info()
929 nk = netkit_priv(peer); in netkit_fill_info()
930 if (nla_put_u32(skb, IFLA_NETKIT_PEER_POLICY, nk->policy)) in netkit_fill_info()