Commit 7a64135f authored by Jesper Dangaard Brouer's avatar Jesper Dangaard Brouer Committed by Daniel Borkmann

libbpf: Adjust SEC short cut for expected attach type BPF_XDP_DEVMAP

Adjust the SEC("xdp_devmap/") prog type prefix to contain a
slash "/" for expected attach type BPF_XDP_DEVMAP.  This is consistent
with other prog types like tracing.

Fixes: 27787970 ("libbpf: Add SEC name for xdp programs attached to device map")
Suggested-by: default avatarAndrii Nakryiko <andriin@fb.com>
Signed-off-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarAndrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/159309521882.821855.6873145686353617509.stgit@firesoul
parent a9b59159
...@@ -6659,7 +6659,7 @@ static const struct bpf_sec_def section_defs[] = { ...@@ -6659,7 +6659,7 @@ static const struct bpf_sec_def section_defs[] = {
.expected_attach_type = BPF_TRACE_ITER, .expected_attach_type = BPF_TRACE_ITER,
.is_attach_btf = true, .is_attach_btf = true,
.attach_fn = attach_iter), .attach_fn = attach_iter),
BPF_EAPROG_SEC("xdp_devmap", BPF_PROG_TYPE_XDP, BPF_EAPROG_SEC("xdp_devmap/", BPF_PROG_TYPE_XDP,
BPF_XDP_DEVMAP), BPF_XDP_DEVMAP),
BPF_PROG_SEC("xdp", BPF_PROG_TYPE_XDP), BPF_PROG_SEC("xdp", BPF_PROG_TYPE_XDP),
BPF_PROG_SEC("perf_event", BPF_PROG_TYPE_PERF_EVENT), BPF_PROG_SEC("perf_event", BPF_PROG_TYPE_PERF_EVENT),
......
...@@ -27,7 +27,7 @@ int xdp_dummy_prog(struct xdp_md *ctx) ...@@ -27,7 +27,7 @@ int xdp_dummy_prog(struct xdp_md *ctx)
/* valid program on DEVMAP entry via SEC name; /* valid program on DEVMAP entry via SEC name;
* has access to egress and ingress ifindex * has access to egress and ingress ifindex
*/ */
SEC("xdp_devmap") SEC("xdp_devmap/map_prog")
int xdp_dummy_dm(struct xdp_md *ctx) int xdp_dummy_dm(struct xdp_md *ctx)
{ {
char fmt[] = "devmap redirect: dev %u -> dev %u len %u\n"; char fmt[] = "devmap redirect: dev %u -> dev %u len %u\n";
......
Markdown is supported
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