Re: building eBPF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/27/20 12:49 PM, Sowmini Varadhan wrote:

The iproute2 BPF-loader does not support BTF.  I think upstream agrees
that it would be too much work to add (and maintain) it, so the current
plan[1] is to convert iproute2 to use libbpf instead.

Not true, iproute2 does(did) support BTF, but afaik later versions of clang/
llvm broke it so it would need to be fixed again [0]. Emission of BTF can be
removed as a workaround w/ omitting -g.

  [0] https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=f823f36012fb5ab4ddfca6ed4ff56188730f281e

So I updated my iproute2 because I was initially getting an error like

" Error fixing up map structure, incompatible struct bpf_elf_map used?
   Error fetching ELF ancillary data!
   Unable to load program
"
with the native iproute2 binaries, and thought it may be due to
a header mismatch.

Why do you want to use 'tc' to load XDP?

I was merely using the exsiting example in samples to try to understand
this. If the existing example is misleading, it should be removed.

I actually think this is only a warning, and the program is actually
loaded...

no I dont believe it is. if you insert a break in the script before
it gets to cleanup, and try

    # ip netns exec ns2 bash
    # tc filter show dev vens2

it will not show any loaded filters.

Check out https://cilium.readthedocs.io/en/latest/bpf/#iproute2 for XDP + iproute2
examples examples for where to check; but agree you might rather want to go with
libbpf's feature set overall.

--Sowmini





[Index of Archives]     [Linux Networking Development]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite Campsites]

  Powered by Linux