diff options
Diffstat (limited to 'include/linux/tcp.h')
-rw-r--r-- | include/linux/tcp.h | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 48c3696e8645..b386361ba3e8 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -112,10 +112,11 @@ struct tcp_request_sock_ops; | |||
112 | struct tcp_request_sock { | 112 | struct tcp_request_sock { |
113 | struct inet_request_sock req; | 113 | struct inet_request_sock req; |
114 | const struct tcp_request_sock_ops *af_specific; | 114 | const struct tcp_request_sock_ops *af_specific; |
115 | struct skb_mstamp snt_synack; /* first SYNACK sent time */ | ||
115 | bool tfo_listener; | 116 | bool tfo_listener; |
117 | u32 txhash; | ||
116 | u32 rcv_isn; | 118 | u32 rcv_isn; |
117 | u32 snt_isn; | 119 | u32 snt_isn; |
118 | u32 snt_synack; /* synack sent time */ | ||
119 | u32 last_oow_ack_time; /* last SYNACK */ | 120 | u32 last_oow_ack_time; /* last SYNACK */ |
120 | u32 rcv_nxt; /* the ack # by SYNACK. For | 121 | u32 rcv_nxt; /* the ack # by SYNACK. For |
121 | * FastOpen it's the seq# | 122 | * FastOpen it's the seq# |
@@ -193,6 +194,12 @@ struct tcp_sock { | |||
193 | u32 window_clamp; /* Maximal window to advertise */ | 194 | u32 window_clamp; /* Maximal window to advertise */ |
194 | u32 rcv_ssthresh; /* Current window clamp */ | 195 | u32 rcv_ssthresh; /* Current window clamp */ |
195 | 196 | ||
197 | /* Information of the most recently (s)acked skb */ | ||
198 | struct tcp_rack { | ||
199 | struct skb_mstamp mstamp; /* (Re)sent time of the skb */ | ||
200 | u8 advanced; /* mstamp advanced since last lost marking */ | ||
201 | u8 reord; /* reordering detected */ | ||
202 | } rack; | ||
196 | u16 advmss; /* Advertised MSS */ | 203 | u16 advmss; /* Advertised MSS */ |
197 | u8 unused; | 204 | u8 unused; |
198 | u8 nonagle : 4,/* Disable Nagle algorithm? */ | 205 | u8 nonagle : 4,/* Disable Nagle algorithm? */ |
@@ -216,6 +223,9 @@ struct tcp_sock { | |||
216 | u32 mdev_max_us; /* maximal mdev for the last rtt period */ | 223 | u32 mdev_max_us; /* maximal mdev for the last rtt period */ |
217 | u32 rttvar_us; /* smoothed mdev_max */ | 224 | u32 rttvar_us; /* smoothed mdev_max */ |
218 | u32 rtt_seq; /* sequence number to update rttvar */ | 225 | u32 rtt_seq; /* sequence number to update rttvar */ |
226 | struct rtt_meas { | ||
227 | u32 rtt, ts; /* RTT in usec and sampling time in jiffies. */ | ||
228 | } rtt_min[3]; | ||
219 | 229 | ||
220 | u32 packets_out; /* Packets which are "in flight" */ | 230 | u32 packets_out; /* Packets which are "in flight" */ |
221 | u32 retrans_out; /* Retransmitted packets out */ | 231 | u32 retrans_out; /* Retransmitted packets out */ |
@@ -279,8 +289,6 @@ struct tcp_sock { | |||
279 | int lost_cnt_hint; | 289 | int lost_cnt_hint; |
280 | u32 retransmit_high; /* L-bits may be on up to this seqno */ | 290 | u32 retransmit_high; /* L-bits may be on up to this seqno */ |
281 | 291 | ||
282 | u32 lost_retrans_low; /* Sent seq after any rxmit (lowest) */ | ||
283 | |||
284 | u32 prior_ssthresh; /* ssthresh saved at recovery start */ | 292 | u32 prior_ssthresh; /* ssthresh saved at recovery start */ |
285 | u32 high_seq; /* snd_nxt at onset of congestion */ | 293 | u32 high_seq; /* snd_nxt at onset of congestion */ |
286 | 294 | ||
@@ -355,8 +363,8 @@ static inline struct tcp_sock *tcp_sk(const struct sock *sk) | |||
355 | 363 | ||
356 | struct tcp_timewait_sock { | 364 | struct tcp_timewait_sock { |
357 | struct inet_timewait_sock tw_sk; | 365 | struct inet_timewait_sock tw_sk; |
358 | u32 tw_rcv_nxt; | 366 | #define tw_rcv_nxt tw_sk.__tw_common.skc_tw_rcv_nxt |
359 | u32 tw_snd_nxt; | 367 | #define tw_snd_nxt tw_sk.__tw_common.skc_tw_snd_nxt |
360 | u32 tw_rcv_wnd; | 368 | u32 tw_rcv_wnd; |
361 | u32 tw_ts_offset; | 369 | u32 tw_ts_offset; |
362 | u32 tw_ts_recent; | 370 | u32 tw_ts_recent; |
@@ -381,25 +389,19 @@ static inline bool tcp_passive_fastopen(const struct sock *sk) | |||
381 | tcp_sk(sk)->fastopen_rsk != NULL); | 389 | tcp_sk(sk)->fastopen_rsk != NULL); |
382 | } | 390 | } |
383 | 391 | ||
384 | extern void tcp_sock_destruct(struct sock *sk); | 392 | static inline void fastopen_queue_tune(struct sock *sk, int backlog) |
393 | { | ||
394 | struct request_sock_queue *queue = &inet_csk(sk)->icsk_accept_queue; | ||
395 | int somaxconn = READ_ONCE(sock_net(sk)->core.sysctl_somaxconn); | ||
396 | |||
397 | queue->fastopenq.max_qlen = min_t(unsigned int, backlog, somaxconn); | ||
398 | } | ||
385 | 399 | ||
386 | static inline int fastopen_init_queue(struct sock *sk, int backlog) | 400 | static inline void tcp_move_syn(struct tcp_sock *tp, |
401 | struct request_sock *req) | ||
387 | { | 402 | { |
388 | struct request_sock_queue *queue = | 403 | tp->saved_syn = req->saved_syn; |
389 | &inet_csk(sk)->icsk_accept_queue; | 404 | req->saved_syn = NULL; |
390 | |||
391 | if (queue->fastopenq == NULL) { | ||
392 | queue->fastopenq = kzalloc( | ||
393 | sizeof(struct fastopen_queue), | ||
394 | sk->sk_allocation); | ||
395 | if (queue->fastopenq == NULL) | ||
396 | return -ENOMEM; | ||
397 | |||
398 | sk->sk_destruct = tcp_sock_destruct; | ||
399 | spin_lock_init(&queue->fastopenq->lock); | ||
400 | } | ||
401 | queue->fastopenq->max_qlen = backlog; | ||
402 | return 0; | ||
403 | } | 405 | } |
404 | 406 | ||
405 | static inline void tcp_saved_syn_free(struct tcp_sock *tp) | 407 | static inline void tcp_saved_syn_free(struct tcp_sock *tp) |