]> git.baikalelectronics.ru Git - kernel.git/commitdiff
libbpf: Adjust SEC short cut for expected attach type BPF_XDP_DEVMAP
authorJesper Dangaard Brouer <brouer@redhat.com>
Thu, 25 Jun 2020 14:26:58 +0000 (16:26 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 25 Jun 2020 20:36:00 +0000 (22:36 +0200)
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: 741ac5eca0ec ("libbpf: Add SEC name for xdp programs attached to device map")
Suggested-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/159309521882.821855.6873145686353617509.stgit@firesoul
tools/lib/bpf/libbpf.c
tools/testing/selftests/bpf/progs/test_xdp_with_devmap_helpers.c

index f17151d866e6dd37950138601544a7d7221bff24..11e4725b8b1c010cf9d198f7457a520556267c59 100644 (file)
@@ -6659,7 +6659,7 @@ 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_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),
index 330811260123260949b58351176df511c887d226..0ac08649772228ebd7846e6a543ce78bbc25168f 100644 (file)
@@ -27,7 +27,7 @@ int xdp_dummy_prog(struct xdp_md *ctx)
 /* valid program on DEVMAP entry via SEC name;
  * has access to egress and ingress ifindex
  */
-SEC("xdp_devmap")
+SEC("xdp_devmap/map_prog")
 int xdp_dummy_dm(struct xdp_md *ctx)
 {
        char fmt[] = "devmap redirect: dev %u -> dev %u len %u\n";