Skip to content

fix build error in bpf selftests

Tianchen Ding lkml stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3bpf: Consolidate shared test timing codenet/bpf/test_run.c+78 -620 replies
2/3bpf: Add PROG_TEST_RUN support for sk_lookup programsinclude/linux/bpf.h include/uapi/linux/bpf.h net/bpf/test_run.c +2 more+124 -20 replies
3/3selftests: bpf: Don't run sk_lookup in verifier teststools/testing/selftests/bpf/test_verifier.c tools/testing/selftests/bpf/verifier/ctx_sk_lookup.c+3 -20 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchAndrii Nakryiko
1/3A-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 5.10 0/3] fix build error in bpf selftests

We found a compile error when building tools/testing/selftests/bpf/ on 5.10.y. 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"))
| ^

To fix this bug, this patchset backports three patches from upstream:
https://lore.kernel.org/bpf/[email protected]/

Patch 1 and 2 are necessary for bpf selftests build pass on 5.10.y. Patch 3 does not impact building stage, but can avoid a test case failure (by skipping it).

Lorenz Bauer (3):
bpf: Consolidate shared test timing code
bpf: Add PROG_TEST_RUN support for sk_lookup programs
selftests: bpf: Don't run sk_lookup in verifier tests

 include/linux/bpf.h                           |  10 +
 include/uapi/linux/bpf.h                      |   5 +-
 net/bpf/test_run.c                            | 243 +++++++++++++-----
 net/core/filter.c                             |   1 +
 tools/include/uapi/linux/bpf.h                |   5 +-
 tools/testing/selftests/bpf/test_verifier.c   |   4 +-
 .../selftests/bpf/verifier/ctx_sk_lookup.c    |   1 +
 7 files changed, 204 insertions(+), 65 deletions(-)
Signature · 1 line
2.27.0