Re: [PATCH 5.10 373/575] selftests: bpf: Convert sk_lookup ctx access tests to PROG_TEST_RUN

From: Greg KH
Date: Sun Jul 31 2022 - 06:52:05 EST


On Thu, Jul 28, 2022 at 11:09:32AM +0800, Tianchen Ding wrote:
> On 2022/7/28 11:03, Tianchen Ding wrote:
> > On 2022/7/27 18:10, Greg KH wrote:
> > > On Mon, Jul 25, 2022 at 10:53:38AM +0800, Tianchen Ding wrote:
> > > > Hi Greg.
> > > >
> > > > We found a compile error when building tools/testing/selftests/bpf/ on 5.10.
> > > >
> > > > tools/testing/selftests/bpf/prog_tests/sk_lookup.c:1092:15: error: 'struct bpf_sk_lookup' has no member named 'cookie'
> > > >   1092 |  if (CHECK(ctx.cookie == 0, "ctx.cookie", "no socket selected\n"))
> > > >
> > > > It requires 7c32e8f8bc33 ("bpf: Add PROG_TEST_RUN support for sk_lookup programs") from upstream.
> > > >
> > > > Maybe the left patches of this patchset are needed for 5.10 LTS?
> > > > https://lore.kernel.org/bpf/20210303101816.36774-1-lmb@xxxxxxxxxxxxxx/
> > >
> > > If so, please submit them with the git commit ids so that I can fix this
> > > up.
> > >
> > > thanks,
> > >
> > > greg k-h
> >
> > These 2 commits from upstream are necessary for bpf selftests build pass on 5.10.y:
> > 607b9cc92bd7208338d714a22b8082fe83bcb177 bpf: Consolidate shared test timing code
> > 7c32e8f8bc33a5f4b113a630857e46634e3e143b bpf: Add PROG_TEST_RUN support for sk_lookup programs
> >
> > This commit does not impact building stage, but can avoid a test case failure (by skipping it):
> > b4f894633fa14d7d46ba7676f950b90a401504bb selftests: bpf: Don't run sk_lookup in verifier tests
> >
> > Thanks.
>
> Or should I submit complete patches?

Yes, please submit complete patches.

thanks,

greg k-h