[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191107172911.7sg3xpezln6hoq3n@kafai-mbp>
Date: Thu, 7 Nov 2019 17:29:14 +0000
From: Martin Lau <kafai@...com>
To: Andrii Nakryiko <andrii.nakryiko@...il.com>
CC: bpf <bpf@...r.kernel.org>, Networking <netdev@...r.kernel.org>,
"Alexei Starovoitov" <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
"David Miller" <davem@...emloft.net>,
Kernel Team <Kernel-team@...com>
Subject: Re: [PATCH v3 bpf-next 3/3] bpf: Add cb access in kfree_skb test
On Wed, Nov 06, 2019 at 06:50:02PM -0800, Andrii Nakryiko wrote:
> On Wed, Nov 6, 2019 at 5:47 PM Martin KaFai Lau <kafai@...com> wrote:
> >
> > Access the skb->cb[] in the kfree_skb test.
> >
> > Signed-off-by: Martin KaFai Lau <kafai@...com>
> > ---
>
> Acked-by: Andrii Nakryiko <andriin@...com>
>
> > .../selftests/bpf/prog_tests/kfree_skb.c | 54 +++++++++++++++----
> > tools/testing/selftests/bpf/progs/kfree_skb.c | 25 +++++++--
> > 2 files changed, 63 insertions(+), 16 deletions(-)
> >
>
> [...]
>
> >
> > + meta.ifindex = _(dev->ifindex);
I hit this when I put "meta.ifindex = dev->ifindex;" inside
__builtin_preserve_access_index:
libbpf: prog 'tp_btf/kfree_skb': relo #0: no matching targets found for [13] meta + 0:0
libbpf: prog 'tp_btf/kfree_skb': relo #0: failed to relocate: -3
libbpf: failed to perform CO-RE relocations: -3
My blind guess was it thought meta has to be relocated too. Hence, I moved it
out such that I can put __builtin_preserve_access_index only to "dev->ifindex".
> > + meta.cb8_0 = cb8[8];
> > + meta.cb32_0 = cb32[2];
These two do not need relo.
>
> Have you tried doing it inside __builtin_preserve_access_index region?
> Does it fail because of extra allocations against meta?
>
> > +
> > bpf_probe_read_kernel(&pkt_type, sizeof(pkt_type), _(&skb->__pkt_type_offset));
> > pkt_type &= 7;
> >
>
> [...]
Powered by blists - more mailing lists