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)
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>

Trivial merge