[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAH3MdRUbkswKAYiDSmhe9cdd-Jd=YmC0_PSLhzfY7vKv-zxCCA@mail.gmail.com>
Date: Mon, 1 Jul 2019 11:39:27 -0700
From: Y Song <ys114321@...il.com>
To: Song Liu <liu.song.a23@...il.com>
Cc: Jiri Benc <jbenc@...hat.com>, Networking <netdev@...r.kernel.org>,
bpf <bpf@...r.kernel.org>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Mathieu Xhonneux <m.xhonneux@...il.com>
Subject: Re: [PATCH bpf] selftests: bpf: fix inlines in test_lwt_seg6local
On Sat, Jun 29, 2019 at 11:05 AM Song Liu <liu.song.a23@...il.com> wrote:
>
> On Sat, Jun 29, 2019 at 11:04 AM Song Liu <liu.song.a23@...il.com> wrote:
> >
> > On Sat, Jun 29, 2019 at 7:43 AM Jiri Benc <jbenc@...hat.com> wrote:
> > >
> > > Selftests are reporting this failure in test_lwt_seg6local.sh:
> > >
> > > + ip netns exec ns2 ip -6 route add fb00::6 encap bpf in obj test_lwt_seg6local.o sec encap_srh dev veth2
> > > Error fetching program/map!
> > > Failed to parse eBPF program: Operation not permitted
> > >
> > > The problem is __attribute__((always_inline)) alone is not enough to prevent
> > > clang from inserting those functions in .text. In that case, .text is not
> > > marked as relocateable.
> > >
> > > See the output of objdump -h test_lwt_seg6local.o:
> > >
> > > Idx Name Size VMA LMA File off Algn
> > > 0 .text 00003530 0000000000000000 0000000000000000 00000040 2**3
> > > CONTENTS, ALLOC, LOAD, READONLY, CODE
> > >
> > > This causes the iproute bpf loader to fail in bpf_fetch_prog_sec:
> > > bpf_has_call_data returns true but bpf_fetch_prog_relo fails as there's no
> > > relocateable .text section in the file.
> > >
> > > Add 'static inline' to fix this.
> > >
> > > Fixes: c99a84eac026 ("selftests/bpf: test for seg6local End.BPF action")
> > > Signed-off-by: Jiri Benc <jbenc@...hat.com>
> >
> > Maybe use "__always_inline" as most other tests do?
>
> I meant "static __always_inline".
By default, we have
# define __always_inline inline __attribute__((always_inline))
So just use __always_inline should be less verbose in your patch.
BTW, what compiler did you use have this behavior?
Did you have issues with `static __attribute__((always_inline))`?
>
> Song
Powered by blists - more mailing lists