bpf: Update bpf_{g,s}etsockopt() documentation
authorJi Rongfeng <SikoJobs@outlook.com>
Fri, 18 Nov 2022 08:18:18 +0000 (16:18 +0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Thu, 24 Nov 2022 00:33:59 +0000 (16:33 -0800)
* append missing optnames to the end
* simplify bpf_getsockopt()'s doc

Signed-off-by: Ji Rongfeng <SikoJobs@outlook.com>
Link: https://lore.kernel.org/r/DU0P192MB15479B86200B1216EC90E162D6099@DU0P192MB1547.EURP192.PROD.OUTLOOK.COM
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
include/uapi/linux/bpf.h
tools/include/uapi/linux/bpf.h

index ab86145df760c7950f15f33becdd231057b91a57..f89de51a45db2dc358eea0bf40f839df6dd4736f 100644 (file)
@@ -2584,14 +2584,19 @@ union bpf_attr {
  *             * **SOL_SOCKET**, which supports the following *optname*\ s:
  *               **SO_RCVBUF**, **SO_SNDBUF**, **SO_MAX_PACING_RATE**,
  *               **SO_PRIORITY**, **SO_RCVLOWAT**, **SO_MARK**,
- *               **SO_BINDTODEVICE**, **SO_KEEPALIVE**.
+ *               **SO_BINDTODEVICE**, **SO_KEEPALIVE**, **SO_REUSEADDR**,
+ *               **SO_REUSEPORT**, **SO_BINDTOIFINDEX**, **SO_TXREHASH**.
  *             * **IPPROTO_TCP**, which supports the following *optname*\ s:
  *               **TCP_CONGESTION**, **TCP_BPF_IW**,
  *               **TCP_BPF_SNDCWND_CLAMP**, **TCP_SAVE_SYN**,
  *               **TCP_KEEPIDLE**, **TCP_KEEPINTVL**, **TCP_KEEPCNT**,
- *               **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**.
+ *               **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**,
+ *               **TCP_NODELAY**, **TCP_MAXSEG**, **TCP_WINDOW_CLAMP**,
+ *               **TCP_THIN_LINEAR_TIMEOUTS**, **TCP_BPF_DELACK_MAX**,
+ *               **TCP_BPF_RTO_MIN**.
  *             * **IPPROTO_IP**, which supports *optname* **IP_TOS**.
- *             * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**.
+ *             * **IPPROTO_IPV6**, which supports the following *optname*\ s:
+ *               **IPV6_TCLASS**, **IPV6_AUTOFLOWLABEL**.
  *     Return
  *             0 on success, or a negative error in case of failure.
  *
@@ -2808,12 +2813,10 @@ union bpf_attr {
  *               and **BPF_CGROUP_INET6_CONNECT**.
  *
  *             This helper actually implements a subset of **getsockopt()**.
- *             It supports the following *level*\ s:
- *
- *             * **IPPROTO_TCP**, which supports *optname*
- *               **TCP_CONGESTION**.
- *             * **IPPROTO_IP**, which supports *optname* **IP_TOS**.
- *             * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**.
+ *             It supports the same set of *optname*\ s that is supported by
+ *             the **bpf_setsockopt**\ () helper.  The exceptions are
+ *             **TCP_BPF_*** is **bpf_setsockopt**\ () only and
+ *             **TCP_SAVED_SYN** is **bpf_getsockopt**\ () only.
  *     Return
  *             0 on success, or a negative error in case of failure.
  *
index 6580448e9f774b1407521b9540bc911dd86decf4..f89de51a45db2dc358eea0bf40f839df6dd4736f 100644 (file)
@@ -2584,14 +2584,19 @@ union bpf_attr {
  *             * **SOL_SOCKET**, which supports the following *optname*\ s:
  *               **SO_RCVBUF**, **SO_SNDBUF**, **SO_MAX_PACING_RATE**,
  *               **SO_PRIORITY**, **SO_RCVLOWAT**, **SO_MARK**,
- *               **SO_BINDTODEVICE**, **SO_KEEPALIVE**.
+ *               **SO_BINDTODEVICE**, **SO_KEEPALIVE**, **SO_REUSEADDR**,
+ *               **SO_REUSEPORT**, **SO_BINDTOIFINDEX**, **SO_TXREHASH**.
  *             * **IPPROTO_TCP**, which supports the following *optname*\ s:
  *               **TCP_CONGESTION**, **TCP_BPF_IW**,
  *               **TCP_BPF_SNDCWND_CLAMP**, **TCP_SAVE_SYN**,
  *               **TCP_KEEPIDLE**, **TCP_KEEPINTVL**, **TCP_KEEPCNT**,
- *               **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**.
+ *               **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**,
+ *               **TCP_NODELAY**, **TCP_MAXSEG**, **TCP_WINDOW_CLAMP**,
+ *               **TCP_THIN_LINEAR_TIMEOUTS**, **TCP_BPF_DELACK_MAX**,
+ *               **TCP_BPF_RTO_MIN**.
  *             * **IPPROTO_IP**, which supports *optname* **IP_TOS**.
- *             * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**.
+ *             * **IPPROTO_IPV6**, which supports the following *optname*\ s:
+ *               **IPV6_TCLASS**, **IPV6_AUTOFLOWLABEL**.
  *     Return
  *             0 on success, or a negative error in case of failure.
  *
@@ -2647,7 +2652,7 @@ union bpf_attr {
  *     Return
  *             0 on success, or a negative error in case of failure.
  *
- * long bpf_redirect_map(struct bpf_map *map, u32 key, u64 flags)
+ * long bpf_redirect_map(struct bpf_map *map, u64 key, u64 flags)
  *     Description
  *             Redirect the packet to the endpoint referenced by *map* at
  *             index *key*. Depending on its type, this *map* can contain
@@ -2808,12 +2813,10 @@ union bpf_attr {
  *               and **BPF_CGROUP_INET6_CONNECT**.
  *
  *             This helper actually implements a subset of **getsockopt()**.
- *             It supports the following *level*\ s:
- *
- *             * **IPPROTO_TCP**, which supports *optname*
- *               **TCP_CONGESTION**.
- *             * **IPPROTO_IP**, which supports *optname* **IP_TOS**.
- *             * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**.
+ *             It supports the same set of *optname*\ s that is supported by
+ *             the **bpf_setsockopt**\ () helper.  The exceptions are
+ *             **TCP_BPF_*** is **bpf_setsockopt**\ () only and
+ *             **TCP_SAVED_SYN** is **bpf_getsockopt**\ () only.
  *     Return
  *             0 on success, or a negative error in case of failure.
  *