I write a tool with eBPF, which will read the specified packet with XDP. I once compile and run it successfully in 5.04 kernel edition. But when I run it in kernel 4.19, it could be compiled, but error in load and verify. The error message is :
372: (07) r0 += 14
373: (07) r7 += 2
374: (bf) r1 = r0
375: (bf) r3 = r7
376: (85) call bpf_probe_read#4
unknown func bpf_probe_read#4
libbpf: -- END LOG --
libbpf: failed to load program 'xdp_parser_func'
libbpf: failed to load object 'kafkaprobe.bpf.o'
I am curious whether kernel 4.19 could run eBPF&XDP program?
I used other BPF helper function in my program without any problem. bpf_probe_read is the only trouble.
I have try to delete the bpf_probe_read_kernel() in program, and it could work. But it's nonsence if I couldn't read the message in packet. So I want to know there is any other way to read packet in eBPF program.