History

bpf: Add SO_KEEPALIVE and related options to bpf_setsockopt

This patch adds support of SO_KEEPALIVE flag and TCP related options to bpf_setsockopt() routine. This is helpful if we want to enable or tune TCP keepalive for applications which don't do it in the userspace code. v3: - update kernel-doc in uapi (Nikita Vetoshkin <nekto0n@yandex-team.ru>) v4: - update kernel-doc in tools too (Alexei Starovoitov) - add test to selftests (Alexei Starovoitov)

Dmitry Yakunin committed 6 years ago

Commit f9bcf961 parent aad4a0a4 files · +72 −5Browse files

Showing the changes to include/uapi (1 of 4 files). Show all

Unified · Split

include/uapi/linux/bpf.h+5−2
@@ -1621,10 +1621,13 @@ union bpf_attr { · 1620 unmodified lines
1621 *1621 *
1622 * * **SOL_SOCKET**, which supports the following *optname*\ s:1622 * * **SOL_SOCKET**, which supports the following *optname*\ s:
1623 * **SO_RCVBUF**, **SO_SNDBUF**, **SO_MAX_PACING_RATE**,1623 * **SO_RCVBUF**, **SO_SNDBUF**, **SO_MAX_PACING_RATE**,
1624 * **SO_PRIORITY**, **SO_RCVLOWAT**, **SO_MARK**.1624 * **SO_PRIORITY**, **SO_RCVLOWAT**, **SO_MARK**,
1625 * **SO_BINDTODEVICE**, **SO_KEEPALIVE**.
1625 * * **IPPROTO_TCP**, which supports the following *optname*\ s:1626 * * **IPPROTO_TCP**, which supports the following *optname*\ s:
1626 * **TCP_CONGESTION**, **TCP_BPF_IW**,1627 * **TCP_CONGESTION**, **TCP_BPF_IW**,
1627 * **TCP_BPF_SNDCWND_CLAMP**.1628 * **TCP_BPF_SNDCWND_CLAMP**, **TCP_SAVE_SYN**,
1629 * **TCP_KEEPIDLE**, **TCP_KEEPINTVL**, **TCP_KEEPCNT**,
1630 * **TCP_SYNCNT**, **TCP_USER_TIMEOUT**.
1628 * * **IPPROTO_IP**, which supports *optname* **IP_TOS**.1631 * * **IPPROTO_IP**, which supports *optname* **IP_TOS**.
1629 * * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**.1632 * * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**.
1630 * Return1633 * Return