Skip to content

Commit 2778797

Browse files
dsahernAlexei Starovoitov
authored andcommitted
libbpf: Add SEC name for xdp programs attached to device map
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 <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Toke Høiland-Jørgensen <[email protected]> Link: https://lore.kernel.org/bpf/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 64b5902 commit 2778797

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/lib/bpf/libbpf.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6657,6 +6657,8 @@ static const struct bpf_sec_def section_defs[] = {
66576657
.expected_attach_type = BPF_TRACE_ITER,
66586658
.is_attach_btf = true,
66596659
.attach_fn = attach_iter),
6660+
BPF_EAPROG_SEC("xdp_devmap", BPF_PROG_TYPE_XDP,
6661+
BPF_XDP_DEVMAP),
66606662
BPF_PROG_SEC("xdp", BPF_PROG_TYPE_XDP),
66616663
BPF_PROG_SEC("perf_event", BPF_PROG_TYPE_PERF_EVENT),
66626664
BPF_PROG_SEC("lwt_in", BPF_PROG_TYPE_LWT_IN),

0 commit comments

Comments
 (0)