Commit 27787970 authored by David Ahern's avatar David Ahern Committed by Alexei Starovoitov
Browse files

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: default avatarDavid Ahern <dsahern@kernel.org>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/bpf/20200529220716.75383-5-dsahern@kernel.org


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 64b59025
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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),