Lines Matching refs: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;
341 struct bpf_stab *stab = container_of(map, struct bpf_stab, map);
349 for (i = 0; i < stab->map.max_entries; i++) {
350 struct sock **psk = &stab->sks[i];
368 bpf_map_area_free(stab->sks);
369 bpf_map_area_free(stab);
379 struct bpf_stab *stab = container_of(map, struct bpf_stab, map);
385 return READ_ONCE(stab->sks[key]);
415 static int __sock_map_delete(struct bpf_stab *stab, struct sock *sk_test,
421 spin_lock_bh(&stab->lock);
430 spin_unlock_bh(&stab->lock);
437 struct bpf_stab *stab = container_of(map, struct bpf_stab, map);
439 __sock_map_delete(stab, sk, link_raw);
444 struct bpf_stab *stab = container_of(map, struct bpf_stab, map);
451 psk = &stab->sks[i];
452 return __sock_map_delete(stab, NULL, psk);
457 struct bpf_stab *stab = container_of(map, struct bpf_stab, map);
461 if (i == stab->map.max_entries - 1)
463 if (i >= stab->map.max_entries)
473 struct bpf_stab *stab = container_of(map, struct bpf_stab, map);
496 spin_lock_bh(&stab->lock);
497 osk = stab->sks[idx];
506 sock_map_add_link(psock, link, map, &stab->sks[idx]);
507 stab->sks[idx] = sk;
509 sock_map_unref(osk, &stab->sks[idx]);
510 spin_unlock_bh(&stab->lock);
513 spin_unlock_bh(&stab->lock);