Skip to content

bpf: allow wide (u64) aligned loads for some fields of bpf_sock_addr

Stanislav Fomichev bpf netdev 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 3 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/5bpf: rename bpf_ctx_wide_store_ok to bpf_ctx_wide_access_okinclude/linux/filter.h net/core/filter.c+7 -70 replies
2/5bpf: allow wide aligned loads for bpf_sock_addr user_ip6 and msg_src_ip6include/uapi/linux/bpf.h net/core/filter.c+13 -30 replies
3/5selftests/bpf: rename verifier/wide_store.c to verifier/wide_access.ctools/testing/selftests/bpf/verifier/wide_access.c tools/testing/selftests/bpf/verifier/wide_store.c+36 -360 replies
4/5selftests/bpf: add selftests for wide loadstools/testing/selftests/bpf/verifier/wide_access.c+37 -00 replies
5/5bpf: sync bpf.h to tools/tools/include/uapi/linux/bpf.h+2 -20 replies

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAndrii NarkyikoYonghong Song
SeriesA-b A-b
1/5
2/5
3/5
4/5
5/5

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 bpf 0/5] bpf: allow wide (u64) aligned loads for some fields of bpf_sock_addr

When fixing selftests by adding support for wide stores, Yonghong reported that he had seen some examples where clang generates single u64 loads for two adjacent u32s as well:
http://lore.kernel.org/netdev/[email protected]

Let's support aligned u64 reads for some bpf_sock_addr fields as well.

(This can probably wait for bpf-next, I'll defer to Younhong and the maintainers.)

Cc Yonghong Song <[email protected]>

Stanislav Fomichev (5):
bpf: rename bpf_ctx_wide_store_ok to bpf_ctx_wide_access_ok
bpf: allow wide aligned loads for bpf_sock_addr user_ip6 and

    msg_src_ip6

selftests/bpf: rename verifier/wide_store.c to verifier/wide_access.c selftests/bpf: add selftests for wide loads
bpf: sync bpf.h to tools/

 include/linux/filter.h                        |  2 +-
 include/uapi/linux/bpf.h                      |  4 +-
 net/core/filter.c                             | 24 ++++--
 tools/include/uapi/linux/bpf.h                |  4 +-
 .../selftests/bpf/verifier/wide_access.c      | 73 +++++++++++++++++++
 .../selftests/bpf/verifier/wide_store.c       | 36 ---------
 6 files changed, 95 insertions(+), 48 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/verifier/wide_access.c
 delete mode 100644 tools/testing/selftests/bpf/verifier/wide_store.c
Signature · 1 line
2.22.0.510.g264f2c817a-goog