Skip to content
Commit da61e9e3 authored by Andrii Nakryiko's avatar Andrii Nakryiko
Browse files

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: default avatarAndrii Nakryiko <andrii@kernel.org>
parents e32cb12f baeead21
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment