summaryrefslogtreecommitdiffstats
path: root/Documentation/namespaces
diff options
context:
space:
mode:
authorJesper Dangaard Brouer <brouer@redhat.com>2017-05-30 14:37:51 +0200
committerDavid S. Miller <davem@davemloft.net>2017-05-31 12:59:20 -0400
commit7bc57950bd41d40685ca45a4079ce74d5d41250b (patch)
treed49eeafaf1464ffbb0aa72c35c4c4dcf8fc87aec /Documentation/namespaces
parent9831724a08f06f9560fcc3f1132cbd290e5f9149 (diff)
downloadlinux-7bc57950bd41d40685ca45a4079ce74d5d41250b.tar.bz2
samples/bpf: bpf_load.c order of prog_fd[] should correspond with ELF order
An eBPF ELF file generated with LLVM can contain several program section, which can be used for bpf tail calls. The bpf prog file descriptors are accessible via array prog_fd[]. At-least XDP samples assume ordering, and uses prog_fd[0] is the main XDP program to attach. The actual order of array prog_fd[] depend on whether or not a bpf program section is referencing any maps or not. Not using a map result in being loaded/processed after all other prog section. Thus, this can lead to some very strange and hard to debug situation, as the user can only see a FD and cannot correlated that with the ELF section name. The fix is rather simple, and even removes duplicate memcmp code. Simply load program sections as the last step, instead of load_and_attach while processing the relocation section. When working with tail calls, it become even more essential that the order of prog_fd[] is consistant, like the current dependency of the map_fd[] order. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/namespaces')
0 files changed, 0 insertions, 0 deletions