Re: xdp_iphash_to_cpu_cmdline: Error loading BTF: Invalid argument(22)

Jesper Dangaard Brouer <[email protected]>
Newsgroups org.kernel.vger.xdp-newbies
Message-ID <20210625104354.1f85db25@carbon>
On Thu, 24 Jun 2021 18:14:43 -0700
Y Song <[email protected]> wrote:

> On Thu, Jun 24, 2021 at 1:45 PM Ethy H. Brito <[email protected]> wrote:
> >
> > On Thu, 24 Jun 2021 22:16:37 +0200
> > Jesper Dangaard Brouer <[email protected]> wrote:
> >  
> > > On Thu, 24 Jun 2021 17:04:58 -0300
> > > "Ethy H. Brito" <[email protected]> wrote:
> > >  
> > > > On Tue, 22 Jun 2021 17:22:16 -0300
> > > > "Ethy"  wrote:
> > > >  
> > > > > Hi
> > > > >
> > > > > Runing "# ./xdp_iphash_to_cpu --dev eth1 --all-cpus --wan" returns 2 loading errors:
> > > > >
> > > > > ----------------------8<----------------------------------
> > > > > libbpf: Error loading BTF: Invalid argument(22)
> > > > > libbpf: magic: 0xeb9f
> > > > > version: 1
> > > > > flags: 0x0
> > > > > hdr_len: 24
> > > > > type_off: 0
> > > > > type_len: 492
> > > > > str_off: 492
> > > > > str_len: 1724
> > > > > btf_total_size: 2240
> > > > > [1] PTR (anon) type_id=2
> > > > > [2] STRUCT xdp_md size=20 vlen=5
> > > > >   data type_id=3 bits_offset=0
> > > > >   data_end type_id=3 bits_offset=32
> > > > >   data_meta type_id=3 bits_offset=64
> > > > >   ingress_ifindex type_id=3 bits_offset=96
> > > > >   rx_queue_index type_id=3 bits_offset=128
> > > > > [3] TYPEDEF __u32 type_id=4
> > > > > [4] INT unsigned int size=4 bits_offset=0 nr_bits=32 encoding=(none)
> > > > > [5] FUNC_PROTO (anon) return=6 args=(1 ctx)
> > > > > [6] INT int size=4 bits_offset=0 nr_bits=32 encoding=SIGNED
> > > > > [7] FUNC xdp_program type_id=5 vlen != 0
> > > > >
> > > > > libbpf: Error loading ELF section .BTF: -22. Ignored and continue.  
> > >
> > > NOTICE above: "Ignored and continue".
> > >
> > > Thus, this is not a real *error*, instead this is just a (very) verbose
> > > *warning* that your system (kernel version? / compile options?) doesn't
> > > support BTF correctly.  The BTF info is not really needed by
> > > xdp-cpuma-tc, so you can safely ignore this "warning".  
> 
> FYI, the error is due to
>     [7] FUNC xdp_program type_id=5 vlen != 0
> I guess you may have an old libbpf. The new libbpf should do
> sanitization for this.
>   https://lore.kernel.org/bpf/[email protected]/

Ah, thanks for pointing that out!  Guess it is my fault, that I've not
kept git-submodule for libbpf up-to-date in this git-repo.

With the recent interest for xdp-cpumap-tc[1], I will try find some
time to update libbpf and also fix other practical issues that have
been reported to me.

[1] https://github.com/xdp-project/xdp-cpumap-tc
-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.