aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Fastabend <john.fastabend@gmail.com>2018-07-05 11:06:01 -0400
committerAlexei Starovoitov <ast@kernel.org>2018-07-07 18:16:58 -0400
commit1d1ef005dbc6de673c62cbd2562290ada3090463 (patch)
tree91b442e56a0eae99b6be5071dc95eaf2e2cddc12
parent547b3aa451ae2739585547db9fbdee11a43ff999 (diff)
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: 81110384441a ("bpf: sockmap, add hash map support") Signed-off-by: John Fastabend <john.fastabend@gmail.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
-rw-r--r--kernel/bpf/sockmap.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c
index 3847a7ce7dae..00fb2e328d1b 100644
--- a/kernel/bpf/sockmap.c
+++ b/kernel/bpf/sockmap.c
@@ -2467,10 +2467,8 @@ struct sock *__sock_hash_lookup_elem(struct bpf_map *map, void *key)
2467 b = __select_bucket(htab, hash); 2467 b = __select_bucket(htab, hash);
2468 head = &b->head; 2468 head = &b->head;
2469 2469
2470 raw_spin_lock_bh(&b->lock);
2471 l = lookup_elem_raw(head, hash, key, key_size); 2470 l = lookup_elem_raw(head, hash, key, key_size);
2472 sk = l ? l->sk : NULL; 2471 sk = l ? l->sk : NULL;
2473 raw_spin_unlock_bh(&b->lock);
2474 return sk; 2472 return sk;
2475} 2473}
2476 2474