elf: legacy map definitions in ‘maps’ section are not supported by libbpf v1.0+

  Kiến thức lập trình

last week I got stuck in converting p4 code to .o bpf code, finally with lucky I solve it under the help of this link Invalid key type for BPF_MAP_TYPE_ARRAY. P4 programm based on ebpf_model.p4 template, now I get new issues, according to the instruction on p4c-epbf, use tc to load bpf code to kernel, but the version problem occurs, how can I solve it?

# ls
bytecounter.p4  Makefile  out.bc  out.c  out.h  out.o

# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 00:0c:29:86:8d:b4 brd ff:ff:ff:ff:ff:ff
    altname enp2s1
4: cilium_net@cilium_host: <BROADCAST,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether d2:87:17:c4:61:f6 brd ff:ff:ff:ff:ff:ff
5: cilium_host@cilium_net: <BROADCAST,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether ce:72:dd:f0:0b:a4 brd ff:ff:ff:ff:ff:ff

# tc qdisc add dev ens33 clsact
# tc qdisc show dev ens33
qdisc pfifo_fast 0: root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 
qdisc clsact ffff: parent ffff:fff1 
# tc filter add dev cilium_net  egress bpf da obj out.o section prog verbose
libbpf: loading out.o
libbpf: elf: section(3) prog, size 304, link 0, flags 6, type=1
libbpf: sec 'prog': found program 'ebpf_filter' at insn offset 0 (0 bytes), code size 38 insns (304 bytes)
libbpf: elf: section(4) .relprog, size 32, link 27, flags 40, type=9
libbpf: elf: section(5) maps, size 36, link 0, flags 3, type=1
libbpf: elf: legacy map definitions in 'maps' section are not supported by libbpf v1.0+
ERROR: opening BPF object file failed
Unable to load program

Error ” legacy map definitions in ‘maps’ section are not supported by libbpf v1.0+” seems the version problem, but my c code is generated by p4, does anyone have a good idea for solving this issue?

I want to load it to kernel, using tc or bpftool, now I have tried both method, they all have the same issue showed above.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT