]> git.baikalelectronics.ru Git - kernel.git/commitdiff
libbpf: Add SEC name for xdp programs attached to device map
authorDavid Ahern <dsahern@kernel.org>
Fri, 29 May 2020 22:07:15 +0000 (16:07 -0600)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 1 Jun 2020 21:48:32 +0000 (14:48 -0700)
Support SEC("xdp_devmap*") as a short cut for loading the program with
type BPF_PROG_TYPE_XDP and expected attach type BPF_XDP_DEVMAP.

Signed-off-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/bpf/20200529220716.75383-5-dsahern@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/libbpf.c

index 74d967619dcfb0278beacbf9380830d2b98cf915..85d4f1c5fc523e040729dc2bd17c710d360099f7 100644 (file)
@@ -6657,6 +6657,8 @@ static const struct bpf_sec_def section_defs[] = {
                .expected_attach_type = BPF_TRACE_ITER,
                .is_attach_btf = true,
                .attach_fn = attach_iter),
+       BPF_EAPROG_SEC("xdp_devmap",            BPF_PROG_TYPE_XDP,
+                                               BPF_XDP_DEVMAP),
        BPF_PROG_SEC("xdp",                     BPF_PROG_TYPE_XDP),
        BPF_PROG_SEC("perf_event",              BPF_PROG_TYPE_PERF_EVENT),
        BPF_PROG_SEC("lwt_in",                  BPF_PROG_TYPE_LWT_IN),