[bpf-next,0/4] bpf: Replace BPF_ALU and BPF_JMP with BPF_ALU32 and BPF_JMP64

Message ID 1675254998-4951-1-git-send-email-yangtiezhu@loongson.cn
Headers
Series bpf: Replace BPF_ALU and BPF_JMP with BPF_ALU32 and BPF_JMP64 |

Message

Tiezhu Yang Feb. 1, 2023, 12:36 p.m. UTC
  The intention of this patchset is to make the code more readable,
no functional changes, based on bpf-next.

If this patchset makes no sense, please ignore it and sorry for that.

Tiezhu Yang (4):
  bpf: Add new macro BPF_ALU32 and BPF_JMP64
  bpf: treewide: Clean up BPF_ALU and BPF_JMP
  bpf: treewide: Clean up BPF_ALU_* and BPF_JMP_*
  bpf: Mark BPF_ALU and BPF_JMP as deprecated

 Documentation/bpf/clang-notes.rst                  |    2 +-
 Documentation/bpf/classic_vs_extended.rst          |   26 +-
 Documentation/bpf/instruction-set.rst              |   28 +-
 Documentation/bpf/verifier.rst                     |   14 +-
 Documentation/networking/cdc_mbim.rst              |    8 +-
 arch/arm/net/bpf_jit_32.c                          |  110 +--
 arch/arm64/net/bpf_jit_comp.c                      |  112 +--
 arch/loongarch/net/bpf_jit.c                       |  108 +--
 arch/mips/net/bpf_jit_comp32.c                     |  106 +--
 arch/mips/net/bpf_jit_comp64.c                     |  106 +--
 arch/powerpc/net/bpf_jit_comp.c                    |    2 +-
 arch/powerpc/net/bpf_jit_comp32.c                  |  152 +--
 arch/powerpc/net/bpf_jit_comp64.c                  |  162 ++--
 arch/riscv/net/bpf_jit_comp32.c                    |  108 +--
 arch/riscv/net/bpf_jit_comp64.c                    |  120 +--
 arch/s390/net/bpf_jit_comp.c                       |  108 +--
 arch/sparc/net/bpf_jit_comp_32.c                   |   72 +-
 arch/sparc/net/bpf_jit_comp_64.c                   |  108 +--
 arch/x86/net/bpf_jit_comp.c                        |  118 +--
 arch/x86/net/bpf_jit_comp32.c                      |  116 +--
 drivers/net/ethernet/netronome/nfp/bpf/jit.c       |  124 +--
 drivers/net/ethernet/netronome/nfp/bpf/main.h      |    8 +-
 drivers/net/ethernet/netronome/nfp/bpf/verifier.c  |    4 +-
 include/linux/bpf_verifier.h                       |   14 +-
 include/linux/filter.h                             |   38 +-
 include/uapi/linux/bpf.h                           |    2 +
 include/uapi/linux/bpf_common.h                    |    4 +-
 kernel/bpf/arraymap.c                              |   14 +-
 kernel/bpf/core.c                                  |   52 +-
 kernel/bpf/disasm.c                                |   22 +-
 kernel/bpf/hashtab.c                               |    8 +-
 kernel/bpf/syscall.c                               |   12 +-
 kernel/bpf/verifier.c                              |  106 +--
 kernel/seccomp.c                                   |   68 +-
 lib/test_bpf.c                                     | 1004 ++++++++++----------
 net/core/filter.c                                  |  242 ++---
 net/xdp/xskmap.c                                   |    4 +-
 samples/bpf/bpf_insn.h                             |   22 +-
 samples/bpf/cookie_uid_helper_example.c            |   12 +-
 samples/bpf/sock_example.c                         |    4 +-
 samples/bpf/test_cgrp2_attach.c                    |    8 +-
 samples/bpf/test_cgrp2_sock.c                      |    4 +-
 samples/seccomp/bpf-direct.c                       |   18 +-
 samples/seccomp/bpf-helper.c                       |    2 +-
 samples/seccomp/bpf-helper.h                       |   56 +-
 samples/seccomp/dropper.c                          |    4 +-
 samples/seccomp/user-trap.c                        |    2 +-
 tools/bpf/bpf_dbg.c                                |  254 ++---
 tools/bpf/bpf_exp.y                                |  130 +--
 tools/bpf/bpftool/cfg.c                            |    4 +-
 tools/bpf/bpftool/feature.c                        |    4 +-
 tools/include/linux/filter.h                       |   34 +-
 tools/include/uapi/linux/bpf.h                     |    2 +
 tools/include/uapi/linux/bpf_common.h              |    4 +-
 tools/lib/bpf/bpf_endian.h                         |    2 +-
 tools/lib/bpf/gen_loader.c                         |   36 +-
 tools/lib/bpf/libbpf.c                             |   14 +-
 tools/lib/bpf/linker.c                             |    2 +-
 tools/lib/bpf/relo_core.c                          |    4 +-
 tools/perf/util/bpf-prologue.c                     |    8 +-
 tools/testing/selftests/bpf/prog_tests/align.c     |   24 +-
 tools/testing/selftests/bpf/prog_tests/btf.c       |   32 +-
 .../selftests/bpf/prog_tests/cgroup_attach_multi.c |    8 +-
 .../bpf/prog_tests/flow_dissector_load_bytes.c     |    4 +-
 tools/testing/selftests/bpf/prog_tests/sockopt.c   |   42 +-
 tools/testing/selftests/bpf/progs/pyperf600.c      |    2 +-
 tools/testing/selftests/bpf/progs/syscall.c        |    2 +-
 tools/testing/selftests/bpf/test_cgroup_storage.c  |    4 +-
 tools/testing/selftests/bpf/test_lru_map.c         |    4 +-
 tools/testing/selftests/bpf/test_sock.c            |   30 +-
 tools/testing/selftests/bpf/test_sock_addr.c       |    6 +-
 tools/testing/selftests/bpf/test_sysctl.c          |  172 ++--
 tools/testing/selftests/bpf/test_verifier.c        |   44 +-
 tools/testing/selftests/bpf/test_verifier_log.c    |    2 +-
 tools/testing/selftests/bpf/verifier/and.c         |   10 +-
 .../testing/selftests/bpf/verifier/array_access.c  |   92 +-
 tools/testing/selftests/bpf/verifier/atomic_and.c  |   14 +-
 .../testing/selftests/bpf/verifier/atomic_bounds.c |    2 +-
 .../selftests/bpf/verifier/atomic_cmpxchg.c        |   12 +-
 .../testing/selftests/bpf/verifier/atomic_fetch.c  |   12 +-
 .../selftests/bpf/verifier/atomic_fetch_add.c      |    8 +-
 tools/testing/selftests/bpf/verifier/atomic_or.c   |   12 +-
 tools/testing/selftests/bpf/verifier/atomic_xchg.c |    4 +-
 tools/testing/selftests/bpf/verifier/atomic_xor.c  |   10 +-
 tools/testing/selftests/bpf/verifier/basic_call.c  |   14 +-
 tools/testing/selftests/bpf/verifier/basic_instr.c |   14 +-
 tools/testing/selftests/bpf/verifier/basic_stack.c |    2 +-
 tools/testing/selftests/bpf/verifier/bounds.c      |  154 +--
 .../selftests/bpf/verifier/bounds_deduction.c      |   24 +-
 .../bpf/verifier/bounds_mix_sign_unsign.c          |  132 +--
 .../testing/selftests/bpf/verifier/bpf_get_stack.c |   16 +-
 .../selftests/bpf/verifier/bpf_loop_inline.c       |   40 +-
 tools/testing/selftests/bpf/verifier/calls.c       |  594 ++++++------
 tools/testing/selftests/bpf/verifier/cfg.c         |   14 +-
 tools/testing/selftests/bpf/verifier/cgroup_skb.c  |    2 +-
 .../selftests/bpf/verifier/cgroup_storage.c        |   28 +-
 tools/testing/selftests/bpf/verifier/ctx.c         |   24 +-
 tools/testing/selftests/bpf/verifier/ctx_sk_msg.c  |    8 +-
 tools/testing/selftests/bpf/verifier/ctx_skb.c     |  130 +--
 tools/testing/selftests/bpf/verifier/d_path.c      |    4 +-
 tools/testing/selftests/bpf/verifier/dead_code.c   |   56 +-
 .../selftests/bpf/verifier/direct_packet_access.c  |   92 +-
 .../testing/selftests/bpf/verifier/div_overflow.c  |    8 +-
 .../testing/selftests/bpf/verifier/event_output.c  |    2 +-
 .../selftests/bpf/verifier/helper_access_var_len.c |   80 +-
 .../selftests/bpf/verifier/helper_packet_access.c  |   84 +-
 .../selftests/bpf/verifier/helper_restricted.c     |   40 +-
 .../selftests/bpf/verifier/helper_value_access.c   |  132 +--
 .../selftests/bpf/verifier/jeq_infer_not_null.c    |   32 +-
 tools/testing/selftests/bpf/verifier/jit.c         |   50 +-
 tools/testing/selftests/bpf/verifier/jmp32.c       |   32 +-
 tools/testing/selftests/bpf/verifier/jset.c        |   40 +-
 tools/testing/selftests/bpf/verifier/jump.c        |  242 ++---
 tools/testing/selftests/bpf/verifier/junk_insn.c   |    2 +-
 tools/testing/selftests/bpf/verifier/ld_abs.c      |   14 +-
 tools/testing/selftests/bpf/verifier/ld_imm64.c    |    6 +-
 tools/testing/selftests/bpf/verifier/leak_ptr.c    |    4 +-
 tools/testing/selftests/bpf/verifier/loops1.c      |   58 +-
 tools/testing/selftests/bpf/verifier/lwt.c         |   16 +-
 tools/testing/selftests/bpf/verifier/map_in_map.c  |   32 +-
 tools/testing/selftests/bpf/verifier/map_kptr.c    |  126 +--
 tools/testing/selftests/bpf/verifier/map_ptr.c     |    4 +-
 .../selftests/bpf/verifier/map_ptr_mixing.c        |   28 +-
 tools/testing/selftests/bpf/verifier/map_ret_val.c |   12 +-
 tools/testing/selftests/bpf/verifier/meta_access.c |   32 +-
 tools/testing/selftests/bpf/verifier/precise.c     |   44 +-
 .../selftests/bpf/verifier/prevent_map_lookup.c    |    4 +-
 tools/testing/selftests/bpf/verifier/raw_stack.c   |   32 +-
 .../selftests/bpf/verifier/raw_tp_writable.c       |    4 +-
 .../testing/selftests/bpf/verifier/ref_tracking.c  |  164 ++--
 tools/testing/selftests/bpf/verifier/regalloc.c    |   64 +-
 tools/testing/selftests/bpf/verifier/ringbuf.c     |   20 +-
 tools/testing/selftests/bpf/verifier/runtime_jit.c |   50 +-
 .../selftests/bpf/verifier/search_pruning.c        |   66 +-
 tools/testing/selftests/bpf/verifier/sock.c        |  114 +--
 tools/testing/selftests/bpf/verifier/spill_fill.c  |   26 +-
 tools/testing/selftests/bpf/verifier/spin_lock.c   |  126 +--
 tools/testing/selftests/bpf/verifier/stack_ptr.c   |    6 +-
 tools/testing/selftests/bpf/verifier/subreg.c      |   96 +-
 tools/testing/selftests/bpf/verifier/uninit.c      |    2 +-
 tools/testing/selftests/bpf/verifier/unpriv.c      |   60 +-
 tools/testing/selftests/bpf/verifier/value.c       |   10 +-
 .../selftests/bpf/verifier/value_adj_spill.c       |    4 +-
 .../selftests/bpf/verifier/value_illegal_alu.c     |   10 +-
 .../testing/selftests/bpf/verifier/value_or_null.c |   46 +-
 .../selftests/bpf/verifier/value_ptr_arith.c       |  266 +++---
 tools/testing/selftests/bpf/verifier/var_off.c     |    6 +-
 tools/testing/selftests/bpf/verifier/xadd.c        |   16 +-
 tools/testing/selftests/bpf/verifier/xdp.c         |    2 +-
 .../bpf/verifier/xdp_direct_packet_access.c        |  228 ++---
 tools/testing/selftests/net/csum.c                 |    6 +-
 tools/testing/selftests/net/gro.c                  |    8 +-
 tools/testing/selftests/net/psock_fanout.c         |   12 +-
 tools/testing/selftests/net/reuseport_bpf.c        |    6 +-
 tools/testing/selftests/net/reuseport_bpf_numa.c   |    4 +-
 tools/testing/selftests/net/toeplitz.c             |    6 +-
 tools/testing/selftests/seccomp/seccomp_bpf.c      |   68 +-
 157 files changed, 4299 insertions(+), 4295 deletions(-)
  

Comments

Alexei Starovoitov Feb. 2, 2023, 11:26 a.m. UTC | #1
On Wed, Feb 1, 2023 at 4:36 AM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
> The intention of this patchset is to make the code more readable,
> no functional changes, based on bpf-next.
>
> If this patchset makes no sense, please ignore it and sorry for that.
...
>  157 files changed, 4299 insertions(+), 4295 deletions(-)

Are you trying to get to the top of lwn's "most active developers by
lines changed" ?
I'm sure you knew that it's most likely going to be rejected,
yet you still sent it. why?
Your developer's reputation suffers.
Think quality and not quantity.
  
Tiezhu Yang Feb. 2, 2023, 12:55 p.m. UTC | #2
On 02/02/2023 07:26 PM, Alexei Starovoitov wrote:
> On Wed, Feb 1, 2023 at 4:36 AM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>>
>> The intention of this patchset is to make the code more readable,
>> no functional changes, based on bpf-next.
>>
>> If this patchset makes no sense, please ignore it and sorry for that.
> ...
>>  157 files changed, 4299 insertions(+), 4295 deletions(-)
>
> Are you trying to get to the top of lwn's "most active developers by
> lines changed" ?

Oh, no, no intention of doing so.

> I'm sure you knew that it's most likely going to be rejected,
> yet you still sent it. why?

Sorry for the trouble.
Maybe just send patch #1 and #4 as RFC is a proper way.

> Your developer's reputation suffers.
> Think quality and not quantity.
>

Anyway, thank you for your reply.