Lines Matching refs:nkl

610 	struct netkit_link *nkl = netkit_link(link);  in netkit_link_prog_attach()  local
612 struct net_device *dev = nkl->dev; in netkit_link_prog_attach()
631 struct netkit_link *nkl = netkit_link(link); in netkit_link_release() local
637 dev = nkl->dev; in netkit_link_release()
652 nkl->dev = NULL; in netkit_link_release()
662 struct netkit_link *nkl = netkit_link(link); in netkit_link_update() local
668 dev = nkl->dev; in netkit_link_update()
708 const struct netkit_link *nkl = netkit_link(link); in netkit_link_fdinfo() local
712 if (nkl->dev) in netkit_link_fdinfo()
713 ifindex = nkl->dev->ifindex; in netkit_link_fdinfo()
718 nkl->location, in netkit_link_fdinfo()
719 nkl->location == BPF_NETKIT_PRIMARY ? "primary" : "peer"); in netkit_link_fdinfo()
725 const struct netkit_link *nkl = netkit_link(link); in netkit_link_fill_info() local
729 if (nkl->dev) in netkit_link_fill_info()
730 ifindex = nkl->dev->ifindex; in netkit_link_fill_info()
734 info->netkit.attach_type = nkl->location; in netkit_link_fill_info()
753 static int netkit_link_init(struct netkit_link *nkl, in netkit_link_init() argument
759 bpf_link_init(&nkl->link, BPF_LINK_TYPE_NETKIT, in netkit_link_init()
761 nkl->location = attr->link_create.attach_type; in netkit_link_init()
762 nkl->dev = dev; in netkit_link_init()
763 return bpf_link_prime(&nkl->link, link_primer); in netkit_link_init()
769 struct netkit_link *nkl; in netkit_link_attach() local
781 nkl = kzalloc(sizeof(*nkl), GFP_KERNEL_ACCOUNT); in netkit_link_attach()
782 if (!nkl) { in netkit_link_attach()
786 ret = netkit_link_init(nkl, &link_primer, attr, dev, prog); in netkit_link_attach()
788 kfree(nkl); in netkit_link_attach()
791 ret = netkit_link_prog_attach(&nkl->link, in netkit_link_attach()
796 nkl->dev = NULL; in netkit_link_attach()