]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
lwt: Don't disable migration prio invoking BPF.
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Thu, 20 Jun 2024 13:22:01 +0000 (15:22 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 24 Jun 2024 23:41:23 +0000 (16:41 -0700)
There is no need to explicitly disable migration if bottom halves are
also disabled. Disabling BH implies disabling migration.

Remove migrate_disable() and rely solely on disabling BH to remain on
the same CPU.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://patch.msgid.link/20240620132727.660738-12-bigeasy@linutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/lwt_bpf.c

index 4a0797f0a154b29ec9d89d1ea7c7461efd4332eb..a94943681e5aa6bffd9b62f77953292dd4e1bcf6 100644 (file)
@@ -40,10 +40,9 @@ static int run_lwt_bpf(struct sk_buff *skb, struct bpf_lwt_prog *lwt,
 {
        int ret;
 
-       /* Migration disable and BH disable are needed to protect per-cpu
-        * redirect_info between BPF prog and skb_do_redirect().
+       /* Disabling BH is needed to protect per-CPU bpf_redirect_info between
+        * BPF prog and skb_do_redirect().
         */
-       migrate_disable();
        local_bh_disable();
        bpf_compute_data_pointers(skb);
        ret = bpf_prog_run_save_cb(lwt->prog, skb);
@@ -78,7 +77,6 @@ static int run_lwt_bpf(struct sk_buff *skb, struct bpf_lwt_prog *lwt,
        }
 
        local_bh_enable();
-       migrate_enable();
 
        return ret;
 }