Skip to content

Commit 1f82161

Browse files
TaeheeYooborkmann
authored andcommitted
lwt_bpf: remove unnecessary rcu_read_lock in run_lwt_bpf
run_lwt_bpf is called by bpf_{input/output/xmit}. These functions are already protected by rcu_read_lock. because lwtunnel_{input/output/xmit} holds rcu_read_lock and then calls bpf_{input/output/xmit}. So that rcu_read_lock in the run_lwt_bpf is unnecessary. Signed-off-by: Taehee Yoo <ap420073@gmail.com> Acked-by: Yonghong Song <yhs@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
1 parent 486cdf2 commit 1f82161

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

‎net/core/lwt_bpf.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,8 @@ static int run_lwt_bpf(struct sk_buff *skb, struct bpf_lwt_prog *lwt,
5050
* mixing with BH RCU lock doesn't work.
5151
*/
5252
preempt_disable();
53-
rcu_read_lock();
5453
bpf_compute_data_pointers(skb);
5554
ret = bpf_prog_run_save_cb(lwt->prog, skb);
56-
rcu_read_unlock();
5755

5856
switch (ret) {
5957
case BPF_OK:

0 commit comments

Comments
 (0)