All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH bpf-next 0/9] bpf: Clean up _OR_NULL arg types
@ 2021-11-09  2:16 Hao Luo
  2021-11-09  2:16 ` [RFC PATCH bpf-next 2/9] bpf: Remove ARG_PTR_TO_MAP_VALUE_OR_NULL Hao Luo
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: Hao Luo @ 2021-11-09  2:16 UTC (permalink / raw)
  To: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann
  Cc: Martin KaFai Lau, Song Liu, Yonghong Song, KP Singh, bpf, Hao Luo

This is a pure cleanup patchset that tries to use flag to mark whether
an arg may be null. It replaces enum bpf_arg_type with a struct. Doing
so allows us to embed the properties of arguments in the struct, which
is a more scalable solution than introducing a new enum. This patchset
performs this transformation only on arg_type. If it looks good,
follow-up patches will do the same on reg_type and ret_type.

The first patch replaces 'enum bpf_arg_type' with 'struct bpf_arg_type'
and each of the rest patches transforms one type of ARG_XXX_OR_NULLs.

This is purely refactoring patch and should not have any behavior
changes.

Hao Luo (9):
  bpf: Replace enum bpf_arg_type with struct.
  bpf: Remove ARG_PTR_TO_MAP_VALUE_OR_NULL
  bpf: Remove ARG_PTR_TO_MEM_OR_NULL
  bpf: Remove ARG_CONST_SIZE_OR_ZERO
  bpf: Remove ARG_PTR_TO_CTX_OR_NULL
  bpf: Remove ARG_PTR_TO_SOCKET_OR_NULL
  bpf: Remove ARG_PTR_TO_ALLOC_MEM_OR_NULL
  bpf: Rename ARG_CONST_ALLOC_SIZE_OR_ZERO
  bpf: Rename ARG_PTR_TO_STACK_OR_NULL

 include/linux/bpf.h            | 102 ++---
 kernel/bpf/bpf_inode_storage.c |  15 +-
 kernel/bpf/bpf_iter.c          |  11 +-
 kernel/bpf/bpf_lsm.c           |  10 +-
 kernel/bpf/bpf_task_storage.c  |  15 +-
 kernel/bpf/btf.c               |   8 +-
 kernel/bpf/cgroup.c            |  31 +-
 kernel/bpf/core.c              |   8 +-
 kernel/bpf/helpers.c           | 138 ++++---
 kernel/bpf/ringbuf.c           |  32 +-
 kernel/bpf/stackmap.c          |  45 +-
 kernel/bpf/syscall.c           |  16 +-
 kernel/bpf/task_iter.c         |  13 +-
 kernel/bpf/verifier.c          | 179 ++++----
 kernel/trace/bpf_trace.c       | 267 +++++++-----
 net/core/bpf_sk_storage.c      |  41 +-
 net/core/filter.c              | 729 +++++++++++++++++----------------
 net/core/sock_map.c            |  48 +--
 net/ipv4/bpf_tcp_ca.c          |   4 +-
 19 files changed, 932 insertions(+), 780 deletions(-)

-- 
2.34.0.rc0.344.g81b53c2807-goog


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-11-10  5:18 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-09  2:16 [RFC PATCH bpf-next 0/9] bpf: Clean up _OR_NULL arg types Hao Luo
2021-11-09  2:16 ` [RFC PATCH bpf-next 2/9] bpf: Remove ARG_PTR_TO_MAP_VALUE_OR_NULL Hao Luo
2021-11-09  2:16 ` [RFC PATCH bpf-next 3/9] bpf: Remove ARG_PTR_TO_MEM_OR_NULL Hao Luo
2021-11-09  2:16 ` [RFC PATCH bpf-next 4/9] bpf: Remove ARG_CONST_SIZE_OR_ZERO Hao Luo
2021-11-10  4:22   ` Andrii Nakryiko
2021-11-09  2:16 ` [RFC PATCH bpf-next 5/9] bpf: Remove ARG_PTR_TO_CTX_OR_NULL Hao Luo
2021-11-09  2:16 ` [RFC PATCH bpf-next 6/9] bpf: Remove ARG_PTR_TO_SOCKET_OR_NULL Hao Luo
2021-11-09  2:16 ` [RFC PATCH bpf-next 7/9] bpf: Remove ARG_PTR_TO_ALLOC_MEM_OR_NULL Hao Luo
2021-11-09  2:16 ` [RFC PATCH bpf-next 8/9] bpf: Rename ARG_CONST_ALLOC_SIZE_OR_ZERO Hao Luo
2021-11-09  2:16 ` [RFC PATCH bpf-next 9/9] bpf: Rename ARG_PTR_TO_STACK_OR_NULL Hao Luo
2021-11-09 18:21 ` [RFC PATCH bpf-next 0/9] bpf: Clean up _OR_NULL arg types Alexei Starovoitov
2021-11-09 19:42   ` Hao Luo
2021-11-10  4:34     ` Andrii Nakryiko
2021-11-10  4:36       ` Andrii Nakryiko
2021-11-10  4:41         ` Alexei Starovoitov
2021-11-10  5:00           ` Andrii Nakryiko
2021-11-10  5:18             ` Alexei Starovoitov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.