diff options
author | Cong Wang <cong.wang@bytedance.com> | 2020-12-05 10:59:46 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-12-07 22:53:40 +0300 |
commit | e3366884b383073a7edc1bad9634412ae0a22d4e (patch) | |
tree | 6c93ef39131e0a70e15c335b14b5e1f46349b3f0 /net/core/lwt_bpf.c | |
parent | d9054a1ff585ba01029584ab730efc794603d68f (diff) | |
download | linux-e3366884b383073a7edc1bad9634412ae0a22d4e.tar.xz |
lwt_bpf: Replace preempt_disable() with migrate_disable()
migrate_disable() is just a wrapper for preempt_disable() in
non-RT kernel. It is safe to replace it, and RT kernel will
benefit.
Note that it is introduced since Feb 2020.
Suggested-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201205075946.497763-2-xiyou.wangcong@gmail.com
Diffstat (limited to 'net/core/lwt_bpf.c')
-rw-r--r-- | net/core/lwt_bpf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c index 4f3cb7c15ddf..2f7940bcf715 100644 --- a/net/core/lwt_bpf.c +++ b/net/core/lwt_bpf.c @@ -39,10 +39,10 @@ static int run_lwt_bpf(struct sk_buff *skb, struct bpf_lwt_prog *lwt, { int ret; - /* Preempt disable and BH disable are needed to protect per-cpu + /* Migration disable and BH disable are needed to protect per-cpu * redirect_info between BPF prog and skb_do_redirect(). */ - preempt_disable(); + migrate_disable(); local_bh_disable(); bpf_compute_data_pointers(skb); ret = bpf_prog_run_save_cb(lwt->prog, skb); @@ -78,7 +78,7 @@ static int run_lwt_bpf(struct sk_buff *skb, struct bpf_lwt_prog *lwt, } local_bh_enable(); - preempt_enable(); + migrate_enable(); return ret; } |