aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/bpf/prog_tests
diff options
context:
space:
mode:
authorNeal Cardwell <ncardwell@google.com>2020-09-10 15:35:36 -0400
committerAlexei Starovoitov <ast@kernel.org>2020-09-10 20:53:01 -0700
commit5050bef8736facac341fb7e2c0eda5002619acf8 (patch)
treeac322ae7e14ca53346ebf620db5f5dd438ff0aa2 /tools/testing/selftests/bpf/prog_tests
parenttcp: simplify _bpf_setsockopt(): Remove flags argument (diff)
downloadwireguard-linux-5050bef8736facac341fb7e2c0eda5002619acf8.tar.xz
wireguard-linux-5050bef8736facac341fb7e2c0eda5002619acf8.zip
tcp: Simplify tcp_set_congestion_control() load=false case
Simplify tcp_set_congestion_control() by removing the initialization code path for the !load case. There are only two call sites for tcp_set_congestion_control(). The EBPF call site is the only one that passes load=false; it also passes cap_net_admin=true. Because of that, the exact same behavior can be achieved by removing the special if (!load) branch of the logic. Both before and after this commit, the EBPF case will call bpf_try_module_get(), and if that succeeds then call tcp_reinit_congestion_control() or if that fails then return EBUSY. Note that this returns the logic to a structure very similar to the structure before: commit 91b5b21c7c16 ("bpf: Add support for changing congestion control") except that the CAP_NET_ADMIN status is passed in as a function argument. This clean-up was suggested by Martin KaFai Lau. Suggested-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Cc: Lawrence Brakmo <brakmo@fb.com> Cc: Eric Dumazet <edumazet@google.com> Cc: Yuchung Cheng <ycheng@google.com> Cc: Kevin Yang <yyd@google.com>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests')
0 files changed, 0 insertions, 0 deletions