Lines Matching defs:stab
41 struct bpf_stab *stab;
50 stab = bpf_map_area_alloc(sizeof(*stab), NUMA_NO_NODE);
51 if (!stab)
54 bpf_map_init_from_attr(&stab->map, attr);
55 spin_lock_init(&stab->lock);
57 stab->sks = bpf_map_area_alloc((u64) stab->map.max_entries *
59 stab->map.numa_node);
60 if (!stab->sks) {
61 bpf_map_area_free(stab);
65 return &stab->map;
346 struct bpf_stab *stab = container_of(map, struct bpf_stab, map);
354 for (i = 0; i < stab->map.max_entries; i++) {
355 struct sock **psk = &stab->sks[i];
373 bpf_map_area_free(stab->sks);
374 bpf_map_area_free(stab);
384 struct bpf_stab *stab = container_of(map, struct bpf_stab, map);
390 return READ_ONCE(stab->sks[key]);
420 static int __sock_map_delete(struct bpf_stab *stab, struct sock *sk_test,
429 spin_lock_bh(&stab->lock);
439 spin_unlock_bh(&stab->lock);
446 struct bpf_stab *stab = container_of(map, struct bpf_stab, map);
448 __sock_map_delete(stab, sk, link_raw);
453 struct bpf_stab *stab = container_of(map, struct bpf_stab, map);
460 psk = &stab->sks[i];
461 return __sock_map_delete(stab, NULL, psk);
466 struct bpf_stab *stab = container_of(map, struct bpf_stab, map);
470 if (i == stab->map.max_entries - 1)
472 if (i >= stab->map.max_entries)
482 struct bpf_stab *stab = container_of(map, struct bpf_stab, map);
505 spin_lock_bh(&stab->lock);
506 osk = stab->sks[idx];
515 sock_map_add_link(psock, link, map, &stab->sks[idx]);
516 stab->sks[idx] = sk;
518 sock_map_unref(osk, &stab->sks[idx]);
519 spin_unlock_bh(&stab->lock);
522 spin_unlock_bh(&stab->lock);