Lines Matching refs:stab
333 struct bpf_stab *stab = container_of(e->map, struct bpf_stab, map); in bpf_tcp_remove() local
335 raw_spin_lock_bh(&stab->lock); in bpf_tcp_remove()
341 raw_spin_unlock_bh(&stab->lock); in bpf_tcp_remove()
1580 static void sock_map_remove_complete(struct bpf_stab *stab) in sock_map_remove_complete() argument
1582 bpf_map_area_free(stab->sock_map); in sock_map_remove_complete()
1583 kfree(stab); in sock_map_remove_complete()
1659 struct bpf_stab *stab; in sock_map_alloc() local
1675 stab = kzalloc(sizeof(*stab), GFP_USER); in sock_map_alloc()
1676 if (!stab) in sock_map_alloc()
1679 bpf_map_init_from_attr(&stab->map, attr); in sock_map_alloc()
1680 raw_spin_lock_init(&stab->lock); in sock_map_alloc()
1683 cost = (u64) stab->map.max_entries * sizeof(struct sock *); in sock_map_alloc()
1688 stab->map.pages = round_up(cost, PAGE_SIZE) >> PAGE_SHIFT; in sock_map_alloc()
1691 err = bpf_map_precharge_memlock(stab->map.pages); in sock_map_alloc()
1696 stab->sock_map = bpf_map_area_alloc(stab->map.max_entries * in sock_map_alloc()
1698 stab->map.numa_node); in sock_map_alloc()
1699 if (!stab->sock_map) in sock_map_alloc()
1702 return &stab->map; in sock_map_alloc()
1704 kfree(stab); in sock_map_alloc()
1742 struct bpf_stab *stab = container_of(map, struct bpf_stab, map); in sock_map_free() local
1755 raw_spin_lock_bh(&stab->lock); in sock_map_free()
1756 for (i = 0; i < stab->map.max_entries; i++) { in sock_map_free()
1760 sock = stab->sock_map[i]; in sock_map_free()
1763 stab->sock_map[i] = NULL; in sock_map_free()
1771 smap_list_map_remove(psock, &stab->sock_map[i]); in sock_map_free()
1775 raw_spin_unlock_bh(&stab->lock); in sock_map_free()
1778 sock_map_remove_complete(stab); in sock_map_free()
1783 struct bpf_stab *stab = container_of(map, struct bpf_stab, map); in sock_map_get_next_key() local
1787 if (i >= stab->map.max_entries) { in sock_map_get_next_key()
1792 if (i == stab->map.max_entries - 1) in sock_map_get_next_key()
1801 struct bpf_stab *stab = container_of(map, struct bpf_stab, map); in __sock_map_lookup_elem() local
1806 return READ_ONCE(stab->sock_map[key]); in __sock_map_lookup_elem()
1811 struct bpf_stab *stab = container_of(map, struct bpf_stab, map); in sock_map_delete_elem() local
1819 raw_spin_lock_bh(&stab->lock); in sock_map_delete_elem()
1820 sock = stab->sock_map[k]; in sock_map_delete_elem()
1821 stab->sock_map[k] = NULL; in sock_map_delete_elem()
1822 raw_spin_unlock_bh(&stab->lock); in sock_map_delete_elem()
1834 smap_list_map_remove(psock, &stab->sock_map[k]); in sock_map_delete_elem()
1988 struct bpf_stab *stab = container_of(map, struct bpf_stab, map); in sock_map_ctx_update_elem() local
1989 struct bpf_sock_progs *progs = &stab->progs; in sock_map_ctx_update_elem()
1998 if (unlikely(i >= stab->map.max_entries)) in sock_map_ctx_update_elem()
2011 raw_spin_lock_bh(&stab->lock); in sock_map_ctx_update_elem()
2012 osock = stab->sock_map[i]; in sock_map_ctx_update_elem()
2022 e->entry = &stab->sock_map[i]; in sock_map_ctx_update_elem()
2028 stab->sock_map[i] = sock; in sock_map_ctx_update_elem()
2031 smap_list_map_remove(psock, &stab->sock_map[i]); in sock_map_ctx_update_elem()
2034 raw_spin_unlock_bh(&stab->lock); in sock_map_ctx_update_elem()
2038 raw_spin_unlock_bh(&stab->lock); in sock_map_ctx_update_elem()
2050 struct bpf_stab *stab = container_of(map, struct bpf_stab, map); in sock_map_prog() local
2052 progs = &stab->progs; in sock_map_prog()
2149 struct bpf_stab *stab = container_of(map, struct bpf_stab, map); in sock_map_release() local
2151 progs = &stab->progs; in sock_map_release()