чт, 26 сент. 2019 г. в 08:34, Andy Gospodarek <andy@xxxxxxxxxxxxx>: > > On Thu, Sep 26, 2019 at 08:17:48AM -0400, Anton Protopopov wrote: > > чт, 26 сент. 2019 г. в 05:22, Théo Mainguet <theo.mainguet.etu@xxxxxxxxxxxxx>: > > > > > > 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) .... > > > > What's the error message when you are trying to load your program with sudo? > > That information would be helpful as some distros will not run some of > the sample BPF programs without some ulimit changes. For example the > command: > > # ulimit -l 1024 > > or even > > # ulimit -l $VERY_LARGE_VALUE > > may be needed on Fedora or Ubuntu, but not on other distros. > Or even # ulimit -l unlimited :-) Also this can be done from the loader itself, as, e.g., here: https://github.com/xdp-project/xdp-tutorial/blob/master/advanced03-AF_XDP/af_xdp_user.c#L557