* [PATCH bpf-next] lwt_bpf: remove unnecessary rcu_read_lock in run_lwt_bpf
@ 2018-07-30 13:22 Taehee Yoo
2018-07-30 22:22 ` Y Song
2018-07-31 7:27 ` Daniel Borkmann
0 siblings, 2 replies; 3+ messages in thread
From: Taehee Yoo @ 2018-07-30 13:22 UTC (permalink / raw)
To: daniel, ast; +Cc: netdev, ap420073
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>
---
net/core/lwt_bpf.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c
index e7e626f..a49c7ba 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -50,10 +50,8 @@ static int run_lwt_bpf(struct sk_buff *skb, struct bpf_lwt_prog *lwt,
* mixing with BH RCU lock doesn't work.
*/
preempt_disable();
- rcu_read_lock();
bpf_compute_data_pointers(skb);
ret = bpf_prog_run_save_cb(lwt->prog, skb);
- rcu_read_unlock();
switch (ret) {
case BPF_OK:
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH bpf-next] lwt_bpf: remove unnecessary rcu_read_lock in run_lwt_bpf
2018-07-30 13:22 [PATCH bpf-next] lwt_bpf: remove unnecessary rcu_read_lock in run_lwt_bpf Taehee Yoo
@ 2018-07-30 22:22 ` Y Song
2018-07-31 7:27 ` Daniel Borkmann
1 sibling, 0 replies; 3+ messages in thread
From: Y Song @ 2018-07-30 22:22 UTC (permalink / raw)
To: Taehee Yoo; +Cc: Daniel Borkmann, Alexei Starovoitov, netdev
On Mon, Jul 30, 2018 at 6:22 AM, Taehee Yoo <ap420073@gmail.com> wrote:
> 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>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH bpf-next] lwt_bpf: remove unnecessary rcu_read_lock in run_lwt_bpf
2018-07-30 13:22 [PATCH bpf-next] lwt_bpf: remove unnecessary rcu_read_lock in run_lwt_bpf Taehee Yoo
2018-07-30 22:22 ` Y Song
@ 2018-07-31 7:27 ` Daniel Borkmann
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2018-07-31 7:27 UTC (permalink / raw)
To: Taehee Yoo, ast; +Cc: netdev
On 07/30/2018 03:22 PM, Taehee Yoo wrote:
> 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>
Applied to bpf-next, thanks Taehee!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-31 9:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-30 13:22 [PATCH bpf-next] lwt_bpf: remove unnecessary rcu_read_lock in run_lwt_bpf Taehee Yoo
2018-07-30 22:22 ` Y Song
2018-07-31 7:27 ` Daniel Borkmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox