Merge branch 'Support static initialization of BPF_MAP_TYPE_PROG_ARRAY'
authorAndrii Nakryiko <andrii@kernel.org>
Mon, 29 Nov 2021 06:09:08 +0000 (22:09 -0800)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 29 Nov 2021 06:24:57 +0000 (22:24 -0800)
commitda61e9e3aeb5b2ba9569a51231b7648a865cdff3
treef0c2d0b6a5c93ecc665be0b838b8c9b70fca6bc0
parente32cb12ff52a2840fc1248998717f7b95c42f064
parentbaeead213e67a9554d589a2845c634b8e473d107
Merge branch 'Support static initialization of BPF_MAP_TYPE_PROG_ARRAY'

Hengqi Chen says:

====================

Make libbpf support static initialization of BPF_MAP_TYPE_PROG_ARRAY
with a syntax similar to map-in-map initialization:

    SEC("socket")
    int tailcall_1(void *ctx)
    {
        return 0;
    }

    struct {
        __uint(type, BPF_MAP_TYPE_PROG_ARRAY);
        __uint(max_entries, 2);
        __uint(key_size, sizeof(__u32));
        __array(values, int (void *));
    } prog_array_init SEC(".maps") = {
        .values = {
            [1] = (void *)&tailcall_1,
        },
    };

v1->v2:
  - Add stricter checks on relos collect, some renamings (Andrii)
  - Update selftest to check tailcall result (Andrii)
====================

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>