[PATCH bpf-next 0/3] Add support of pointer to struct in global functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patchset adds support of a pointer to struct among global function
arguments.

The motivation is to overcome the limit on the maximum number of allowed
arguments and avoid tricky and unoptimal ways of passing arguments.

The limitation is that used structs may not contain any other pointers.

Dmitrii Banshchikov (3):
  bpf: Factor out nullable reg type conversion
  bpf: Support pointer to struct in global func args
  selftests/bpf: Add unit tests for global functions

 include/linux/bpf_verifier.h                  |   2 +
 kernel/bpf/btf.c                              |  59 ++++++++--
 kernel/bpf/verifier.c                         | 107 ++++++++++++------
 .../bpf/prog_tests/test_global_funcs.c        |   5 +
 .../selftests/bpf/progs/test_global_func10.c  |  29 +++++
 .../selftests/bpf/progs/test_global_func11.c  |  19 ++++
 .../selftests/bpf/progs/test_global_func12.c  |  21 ++++
 .../selftests/bpf/progs/test_global_func13.c  |  24 ++++
 .../selftests/bpf/progs/test_global_func9.c   |  59 ++++++++++
 9 files changed, 284 insertions(+), 41 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/test_global_func10.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_global_func11.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_global_func12.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_global_func13.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_global_func9.c

-- 
2.25.1




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux