From: Paolo Abeni Date: Thu, 21 Sep 2023 19:49:45 +0000 (+0200) Subject: Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e9cbc89067cce78211c8629c78e931c0fe64e29d;p=linux.git Merge git://git./linux/kernel/git/netdev/net Cross-merge networking fixes after downstream PR. No conflicts. Signed-off-by: Paolo Abeni --- e9cbc89067cce78211c8629c78e931c0fe64e29d diff --cc kernel/bpf/memalloc.c index 961df89d45f12,cf19415166437..0ad175277f898 --- a/kernel/bpf/memalloc.c +++ b/kernel/bpf/memalloc.c @@@ -497,12 -525,7 +525,11 @@@ int bpf_mem_alloc_init(struct bpf_mem_a struct bpf_mem_caches *cc, __percpu *pcc; struct bpf_mem_cache *c, __percpu *pc; struct obj_cgroup *objcg = NULL; - int cpu, i, unit_size, percpu_size = 0; + /* room for llist_node and per-cpu pointer */ + if (percpu) + percpu_size = LLIST_NODE_SZ + sizeof(void *); + if (size) { pc = __alloc_percpu_gfp(sizeof(*pc), 8, GFP_KERNEL); if (!pc) @@@ -540,13 -572,31 +569,32 @@@ c = &cc->cache[i]; c->unit_size = sizes[i]; c->objcg = objcg; + c->percpu_size = percpu_size; c->tgt = c; + + init_refill_work(c); + /* Another bpf_mem_cache will be used when allocating + * c->unit_size in bpf_mem_alloc(), so doesn't prefill + * for the bpf_mem_cache because these free objects will + * never be used. + */ + if (i != bpf_mem_cache_idx(c->unit_size)) + continue; prefill_mem_cache(c, cpu); + err = check_obj_size(c, i); + if (err) + goto out; } } + + out: ma->caches = pcc; - return 0; + /* refill_work is either zeroed or initialized, so it is safe to + * call irq_work_sync(). + */ + if (err) + bpf_mem_alloc_destroy(ma); + return err; } static void drain_mem_cache(struct bpf_mem_cache *c) diff --cc tools/testing/selftests/bpf/DENYLIST.aarch64 index f5065576cae95,3babaf3eee5c4..1e827c24761c6 --- a/tools/testing/selftests/bpf/DENYLIST.aarch64 +++ b/tools/testing/selftests/bpf/DENYLIST.aarch64 @@@ -1,15 -1,8 +1,9 @@@ bpf_cookie/multi_kprobe_attach_api # kprobe_multi_link_api_subtest:FAIL:fentry_raw_skel_load unexpected error: -3 bpf_cookie/multi_kprobe_link_api # kprobe_multi_link_api_subtest:FAIL:fentry_raw_skel_load unexpected error: -3 +exceptions # JIT does not support calling kfunc bpf_throw: -524 fexit_sleep # The test never returns. The remaining tests cannot start. - kprobe_multi_bench_attach # bpf_program__attach_kprobe_multi_opts unexpected error: -95 - kprobe_multi_test/attach_api_addrs # bpf_program__attach_kprobe_multi_opts unexpected error: -95 - kprobe_multi_test/attach_api_pattern # bpf_program__attach_kprobe_multi_opts unexpected error: -95 - kprobe_multi_test/attach_api_syms # bpf_program__attach_kprobe_multi_opts unexpected error: -95 - kprobe_multi_test/bench_attach # bpf_program__attach_kprobe_multi_opts unexpected error: -95 - kprobe_multi_test/link_api_addrs # link_fd unexpected link_fd: actual -95 < expected 0 - kprobe_multi_test/link_api_syms # link_fd unexpected link_fd: actual -95 < expected 0 - kprobe_multi_test/skel_api # libbpf: failed to load BPF skeleton 'kprobe_multi': -3 + kprobe_multi_bench_attach # needs CONFIG_FPROBE + kprobe_multi_test # needs CONFIG_FPROBE module_attach # prog 'kprobe_multi': failed to auto-attach: -95 fentry_test/fentry_many_args # fentry_many_args:FAIL:fentry_many_args_attach unexpected error: -524 fexit_test/fexit_many_args # fexit_many_args:FAIL:fexit_many_args_attach unexpected error: -524