[PATCH bpf-next 0/5] bpf: Remove recursion check for struct_ops prog

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

 



From: Martin KaFai Lau <martin.lau@xxxxxxxxxx>

The struct_ops is sharing the tracing-trampoline's enter/exit
function which tracks prog->active to avoid recursion.  It turns
out the struct_ops bpf prog will hit this prog->active and
unnecessarily skipped running the struct_ops prog.  eg.  The
'.ssthresh' may run in_task() and then interrupted by softirq
that runs the same '.ssthresh'.

The kernel does not call the tcp-cc's ops in a recursive way,
so this set is to remove the recursion check for struct_ops prog.

Martin KaFai Lau (5):
  bpf: Add __bpf_prog_{enter,exit}_struct_ops for struct_ops trampoline
  bpf: Move the "cdg" tcp-cc check to the common sol_tcp_sockopt()
  bpf: Add bpf_run_ctx_type
  bpf: Stop bpf_setsockopt(TCP_CONGESTION) in init ops to recur itself
  selftests/bpf: Check -EBUSY for the recurred
    bpf_setsockopt(TCP_CONGESTION)

 arch/x86/net/bpf_jit_comp.c                   |  3 ++
 include/linux/bpf.h                           | 21 ++++++--
 include/linux/filter.h                        |  3 ++
 kernel/bpf/bpf_iter.c                         |  2 +-
 kernel/bpf/cgroup.c                           |  2 +-
 kernel/bpf/trampoline.c                       | 27 ++++++++++
 kernel/trace/bpf_trace.c                      |  1 +
 net/bpf/test_run.c                            |  2 +-
 net/core/filter.c                             | 17 +++---
 net/ipv4/bpf_tcp_ca.c                         | 54 +++++++++++++++++++
 .../selftests/bpf/prog_tests/bpf_tcp_ca.c     |  4 ++
 tools/testing/selftests/bpf/progs/bpf_dctcp.c | 23 +++++---
 12 files changed, 139 insertions(+), 20 deletions(-)

-- 
2.30.2





[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