v2: Added details about the test in commit log This patch contains support to set and get socket options from setsockopt bpf program. This enables us to set multiple socket option when the user changes a particular socket option. Example use case, when the user sets the IPV6_TCLASS socket option we would also like to change the tcp-cc for that socket. We don't have any use case for calling bpf_setsockopt from supposedly read-only sys_getsockopt, so it is made available to BPF_CGROUP_SETSOCKOPT only. Prankur gupta (2): bpf: Add support for {set|get} socket options from setsockopt BPF selftests/bpf: Add test for {set|get} socket option from setsockopt BPF program kernel/bpf/cgroup.c | 8 +++ tools/testing/selftests/bpf/bpf_tcp_helpers.h | 18 +++++ .../bpf/prog_tests/sockopt_qos_to_cc.c | 70 +++++++++++++++++++ .../selftests/bpf/progs/sockopt_qos_to_cc.c | 39 +++++++++++ 4 files changed, 135 insertions(+) create mode 100644 tools/testing/selftests/bpf/prog_tests/sockopt_qos_to_cc.c create mode 100644 tools/testing/selftests/bpf/progs/sockopt_qos_to_cc.c -- 2.30.2