Hi,Thank you very much for your xdp tutorial. Currently, I try to write a simple xdp program to count the number of TCP and UDP packets I receive. For that, I created a BPF_MAP_TYPE_ARRAY map in my kern.c file. I can read into this map with the bpf_map_lookup_elem function but when I try to update a value, I have an error message "libbpf: load bpf program failed: Permission denied". To solve this issue, I've try to run it in sudo, I've verify my kernel configuration (everything needed seems enable) ....
I searched a solution on the internet but I didn't found anything relevant. I hope you can help me.
Théo Mainguet My kernel configuration : $ cat /boot/config-4.19.0-6-amd64 | grep BPF CONFIG_CGROUP_BPF=y CONFIG_BPF=y CONFIG_BPF_SYSCALL=y # CONFIG_BPF_JIT_ALWAYS_ON is not set CONFIG_IPV6_SEG6_BPF=y CONFIG_NETFILTER_XT_MATCH_BPF=m # CONFIG_BPFILTER is not set CONFIG_NET_CLS_BPF=m CONFIG_NET_ACT_BPF=m CONFIG_BPF_JIT=y CONFIG_BPF_STREAM_PARSER=y CONFIG_LWTUNNEL_BPF=y CONFIG_HAVE_EBPF_JIT=y CONFIG_BPF_EVENTS=y # CONFIG_BPF_KPROBE_OVERRIDE is not set CONFIG_TEST_BPF=m