Lines Matching refs:ondev
82 struct bpf_offload_netdev *ondev; in bpf_prog_offload_init() local
106 ondev = bpf_offload_find_netdev(offload->netdev); in bpf_prog_offload_init()
107 if (!ondev) { in bpf_prog_offload_init()
111 offload->offdev = ondev->offdev; in bpf_prog_offload_init()
113 list_add_tail(&offload->offloads, &ondev->progs); in bpf_prog_offload_init()
362 struct bpf_offload_netdev *ondev; in bpf_map_offload_map_alloc() local
385 ondev = bpf_offload_find_netdev(offmap->netdev); in bpf_map_offload_map_alloc()
386 if (!ondev) { in bpf_map_offload_map_alloc()
395 list_add_tail(&offmap->offloads, &ondev->maps); in bpf_map_offload_map_alloc()
595 struct bpf_offload_netdev *ondev; in bpf_offload_dev_netdev_register() local
598 ondev = kzalloc(sizeof(*ondev), GFP_KERNEL); in bpf_offload_dev_netdev_register()
599 if (!ondev) in bpf_offload_dev_netdev_register()
602 ondev->netdev = netdev; in bpf_offload_dev_netdev_register()
603 ondev->offdev = offdev; in bpf_offload_dev_netdev_register()
604 INIT_LIST_HEAD(&ondev->progs); in bpf_offload_dev_netdev_register()
605 INIT_LIST_HEAD(&ondev->maps); in bpf_offload_dev_netdev_register()
608 err = rhashtable_insert_fast(&offdevs, &ondev->l, offdevs_params); in bpf_offload_dev_netdev_register()
614 list_add(&ondev->offdev_netdevs, &offdev->netdevs); in bpf_offload_dev_netdev_register()
620 kfree(ondev); in bpf_offload_dev_netdev_register()
628 struct bpf_offload_netdev *ondev, *altdev; in bpf_offload_dev_netdev_unregister() local
635 ondev = rhashtable_lookup_fast(&offdevs, &netdev, offdevs_params); in bpf_offload_dev_netdev_unregister()
636 if (WARN_ON(!ondev)) in bpf_offload_dev_netdev_unregister()
639 WARN_ON(rhashtable_remove_fast(&offdevs, &ondev->l, offdevs_params)); in bpf_offload_dev_netdev_unregister()
640 list_del(&ondev->offdev_netdevs); in bpf_offload_dev_netdev_unregister()
647 list_for_each_entry(offload, &ondev->progs, offloads) in bpf_offload_dev_netdev_unregister()
649 list_splice_init(&ondev->progs, &altdev->progs); in bpf_offload_dev_netdev_unregister()
651 list_for_each_entry(offmap, &ondev->maps, offloads) in bpf_offload_dev_netdev_unregister()
653 list_splice_init(&ondev->maps, &altdev->maps); in bpf_offload_dev_netdev_unregister()
655 list_for_each_entry_safe(offload, ptmp, &ondev->progs, offloads) in bpf_offload_dev_netdev_unregister()
657 list_for_each_entry_safe(offmap, mtmp, &ondev->maps, offloads) in bpf_offload_dev_netdev_unregister()
661 WARN_ON(!list_empty(&ondev->progs)); in bpf_offload_dev_netdev_unregister()
662 WARN_ON(!list_empty(&ondev->maps)); in bpf_offload_dev_netdev_unregister()
663 kfree(ondev); in bpf_offload_dev_netdev_unregister()