Skip to content

Commit 1d1ef00

Browse files
jrfastabAlexei Starovoitov
authored andcommitted
bpf: sockmap, hash table is RCU so readers do not need locks
This removes locking from readers of RCU hash table. Its not necessary. Fixes: 8111038 ("bpf: sockmap, add hash map support") Signed-off-by: John Fastabend <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 547b3aa commit 1d1ef00

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

kernel/bpf/sockmap.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2467,10 +2467,8 @@ struct sock *__sock_hash_lookup_elem(struct bpf_map *map, void *key)
24672467
b = __select_bucket(htab, hash);
24682468
head = &b->head;
24692469

2470-
raw_spin_lock_bh(&b->lock);
24712470
l = lookup_elem_raw(head, hash, key, key_size);
24722471
sk = l ? l->sk : NULL;
2473-
raw_spin_unlock_bh(&b->lock);
24742472
return sk;
24752473
}
24762474

0 commit comments

Comments
 (0)