hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/include/uapi/linux/tcp.h
....@@ -127,6 +127,9 @@
127127
128128 #define TCP_CM_INQ TCP_INQ
129129
130
+#define TCP_TX_DELAY 37 /* delay outgoing packets by XX usec */
131
+
132
+
130133 #define TCP_REPAIR_ON 1
131134 #define TCP_REPAIR_OFF 0
132135 #define TCP_REPAIR_OFF_NO_WP -1 /* Turn off without window probes */
....@@ -152,6 +155,14 @@
152155 TCP_QUEUES_NR,
153156 };
154157
158
+/* why fastopen failed from client perspective */
159
+enum tcp_fastopen_client_fail {
160
+ TFO_STATUS_UNSPEC, /* catch-all */
161
+ TFO_COOKIE_UNAVAILABLE, /* if not in TFO_CLIENT_NO_COOKIE mode */
162
+ TFO_DATA_NOT_ACKED, /* SYN-ACK did not ack SYN data */
163
+ TFO_SYN_RETRANSMITTED, /* SYN-ACK did not ack SYN data after timeout */
164
+};
165
+
155166 /* for TCP_INFO socket option */
156167 #define TCPI_OPT_TIMESTAMPS 1
157168 #define TCPI_OPT_SACK 2
....@@ -160,15 +171,42 @@
160171 #define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */
161172 #define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */
162173
174
+/*
175
+ * Sender's congestion state indicating normal or abnormal situations
176
+ * in the last round of packets sent. The state is driven by the ACK
177
+ * information and timer events.
178
+ */
163179 enum tcp_ca_state {
180
+ /*
181
+ * Nothing bad has been observed recently.
182
+ * No apparent reordering, packet loss, or ECN marks.
183
+ */
164184 TCP_CA_Open = 0,
165185 #define TCPF_CA_Open (1<<TCP_CA_Open)
186
+ /*
187
+ * The sender enters disordered state when it has received DUPACKs or
188
+ * SACKs in the last round of packets sent. This could be due to packet
189
+ * loss or reordering but needs further information to confirm packets
190
+ * have been lost.
191
+ */
166192 TCP_CA_Disorder = 1,
167193 #define TCPF_CA_Disorder (1<<TCP_CA_Disorder)
194
+ /*
195
+ * The sender enters Congestion Window Reduction (CWR) state when it
196
+ * has received ACKs with ECN-ECE marks, or has experienced congestion
197
+ * or packet discard on the sender host (e.g. qdisc).
198
+ */
168199 TCP_CA_CWR = 2,
169200 #define TCPF_CA_CWR (1<<TCP_CA_CWR)
201
+ /*
202
+ * The sender is in fast recovery and retransmitting lost packets,
203
+ * typically triggered by ACK events.
204
+ */
170205 TCP_CA_Recovery = 3,
171206 #define TCPF_CA_Recovery (1<<TCP_CA_Recovery)
207
+ /*
208
+ * The sender is in loss recovery triggered by retransmission timeout.
209
+ */
172210 TCP_CA_Loss = 4
173211 #define TCPF_CA_Loss (1<<TCP_CA_Loss)
174212 };
....@@ -181,7 +219,7 @@
181219 __u8 tcpi_backoff;
182220 __u8 tcpi_options;
183221 __u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
184
- __u8 tcpi_delivery_rate_app_limited:1;
222
+ __u8 tcpi_delivery_rate_app_limited:1, tcpi_fastopen_client_fail:2;
185223
186224 __u32 tcpi_rto;
187225 __u32 tcpi_ato;
....@@ -240,6 +278,12 @@
240278 __u64 tcpi_bytes_retrans; /* RFC4898 tcpEStatsPerfOctetsRetrans */
241279 __u32 tcpi_dsack_dups; /* RFC4898 tcpEStatsStackDSACKDups */
242280 __u32 tcpi_reord_seen; /* reordering events seen */
281
+
282
+ __u32 tcpi_rcv_ooopack; /* Out-of-order packets received */
283
+
284
+ __u32 tcpi_snd_wnd; /* peer's advertised receive window after
285
+ * scaling (bytes)
286
+ */
243287 };
244288
245289 /* netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */
....@@ -266,20 +310,25 @@
266310 TCP_NLA_BYTES_RETRANS, /* Data bytes retransmitted */
267311 TCP_NLA_DSACK_DUPS, /* DSACK blocks received */
268312 TCP_NLA_REORD_SEEN, /* reordering events seen */
313
+ TCP_NLA_SRTT, /* smoothed RTT in usecs */
314
+ TCP_NLA_TIMEOUT_REHASH, /* Timeout-triggered rehash attempts */
315
+ TCP_NLA_BYTES_NOTSENT, /* Bytes in write queue not yet sent */
316
+ TCP_NLA_EDT, /* Earliest departure time (CLOCK_MONOTONIC) */
269317 };
270318
271319 /* for TCP_MD5SIG socket option */
272320 #define TCP_MD5SIG_MAXKEYLEN 80
273321
274322 /* tcp_md5sig extension flags for TCP_MD5SIG_EXT */
275
-#define TCP_MD5SIG_FLAG_PREFIX 1 /* address prefix length */
323
+#define TCP_MD5SIG_FLAG_PREFIX 0x1 /* address prefix length */
324
+#define TCP_MD5SIG_FLAG_IFINDEX 0x2 /* ifindex set */
276325
277326 struct tcp_md5sig {
278327 struct __kernel_sockaddr_storage tcpm_addr; /* address associated */
279328 __u8 tcpm_flags; /* extension flags */
280329 __u8 tcpm_prefixlen; /* address prefix */
281330 __u16 tcpm_keylen; /* key length */
282
- __u32 __tcpm_pad; /* zero */
331
+ int tcpm_ifindex; /* device index for scope */
283332 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */
284333 };
285334
....@@ -298,5 +347,9 @@
298347 __u64 address; /* in: address of mapping */
299348 __u32 length; /* in/out: number of bytes to map/mapped */
300349 __u32 recv_skip_hint; /* out: amount of bytes to skip */
350
+ __u32 inq; /* out: amount of bytes in read queue */
351
+ __s32 err; /* out: socket error */
352
+ __u64 copybuf_address; /* in: copybuf address (small reads) */
353
+ __s32 copybuf_len; /* in/out: copybuf bytes avail/used or error */
301354 };
302355 #endif /* _UAPI_LINUX_TCP_H */