tcp_input.c (d635fbe27ebee0f4b845abe5e9620c9400785a5c) | tcp_input.c (c2203cf75ed7dfab8dfc7ac915a726880ee7512f) |
---|---|
1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * Implementation of the Transmission Control Protocol(TCP). 7 * 8 * Authors: Ross Biro --- 449 unchanged lines hidden (view full) --- 458 459 /* Force reservation of one segment. */ 460 if (sysctl_tcp_app_win && 461 tp->window_clamp > 2 * tp->advmss && 462 tp->window_clamp + tp->advmss > maxwin) 463 tp->window_clamp = max(2 * tp->advmss, maxwin - tp->advmss); 464 465 tp->rcv_ssthresh = min(tp->rcv_ssthresh, tp->window_clamp); | 1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * Implementation of the Transmission Control Protocol(TCP). 7 * 8 * Authors: Ross Biro --- 449 unchanged lines hidden (view full) --- 458 459 /* Force reservation of one segment. */ 460 if (sysctl_tcp_app_win && 461 tp->window_clamp > 2 * tp->advmss && 462 tp->window_clamp + tp->advmss > maxwin) 463 tp->window_clamp = max(2 * tp->advmss, maxwin - tp->advmss); 464 465 tp->rcv_ssthresh = min(tp->rcv_ssthresh, tp->window_clamp); |
466 tp->snd_cwnd_stamp = tcp_time_stamp; | 466 tp->snd_cwnd_stamp = tcp_jiffies32; |
467} 468 469/* 5. Recalculate window clamp after socket hit its memory bounds. */ 470static void tcp_clamp_window(struct sock *sk) 471{ 472 struct tcp_sock *tp = tcp_sk(sk); 473 struct inet_connection_sock *icsk = inet_csk(sk); 474 --- 1474 unchanged lines hidden (view full) --- 1949 (icsk->icsk_ca_state == TCP_CA_Loss && !icsk->icsk_retransmits)) { 1950 tp->prior_ssthresh = tcp_current_ssthresh(sk); 1951 tp->snd_ssthresh = icsk->icsk_ca_ops->ssthresh(sk); 1952 tcp_ca_event(sk, CA_EVENT_LOSS); 1953 tcp_init_undo(tp); 1954 } 1955 tp->snd_cwnd = 1; 1956 tp->snd_cwnd_cnt = 0; | 467} 468 469/* 5. Recalculate window clamp after socket hit its memory bounds. */ 470static void tcp_clamp_window(struct sock *sk) 471{ 472 struct tcp_sock *tp = tcp_sk(sk); 473 struct inet_connection_sock *icsk = inet_csk(sk); 474 --- 1474 unchanged lines hidden (view full) --- 1949 (icsk->icsk_ca_state == TCP_CA_Loss && !icsk->icsk_retransmits)) { 1950 tp->prior_ssthresh = tcp_current_ssthresh(sk); 1951 tp->snd_ssthresh = icsk->icsk_ca_ops->ssthresh(sk); 1952 tcp_ca_event(sk, CA_EVENT_LOSS); 1953 tcp_init_undo(tp); 1954 } 1955 tp->snd_cwnd = 1; 1956 tp->snd_cwnd_cnt = 0; |
1957 tp->snd_cwnd_stamp = tcp_time_stamp; | 1957 tp->snd_cwnd_stamp = tcp_jiffies32; |
1958 1959 tp->retrans_out = 0; 1960 tp->lost_out = 0; 1961 1962 if (tcp_is_reno(tp)) 1963 tcp_reset_reno_sack(tp); 1964 1965 skb = tcp_write_queue_head(sk); --- 412 unchanged lines hidden (view full) --- 2378 2379 tp->snd_cwnd = icsk->icsk_ca_ops->undo_cwnd(sk); 2380 2381 if (tp->prior_ssthresh > tp->snd_ssthresh) { 2382 tp->snd_ssthresh = tp->prior_ssthresh; 2383 tcp_ecn_withdraw_cwr(tp); 2384 } 2385 } | 1958 1959 tp->retrans_out = 0; 1960 tp->lost_out = 0; 1961 1962 if (tcp_is_reno(tp)) 1963 tcp_reset_reno_sack(tp); 1964 1965 skb = tcp_write_queue_head(sk); --- 412 unchanged lines hidden (view full) --- 2378 2379 tp->snd_cwnd = icsk->icsk_ca_ops->undo_cwnd(sk); 2380 2381 if (tp->prior_ssthresh > tp->snd_ssthresh) { 2382 tp->snd_ssthresh = tp->prior_ssthresh; 2383 tcp_ecn_withdraw_cwr(tp); 2384 } 2385 } |
2386 tp->snd_cwnd_stamp = tcp_time_stamp; | 2386 tp->snd_cwnd_stamp = tcp_jiffies32; |
2387 tp->undo_marker = 0; 2388} 2389 2390static inline bool tcp_may_undo(const struct tcp_sock *tp) 2391{ 2392 return tp->undo_marker && (!tp->undo_retrans || tcp_packet_delayed(tp)); 2393} 2394 --- 120 unchanged lines hidden (view full) --- 2515 2516 if (inet_csk(sk)->icsk_ca_ops->cong_control) 2517 return; 2518 2519 /* Reset cwnd to ssthresh in CWR or Recovery (unless it's undone) */ 2520 if (inet_csk(sk)->icsk_ca_state == TCP_CA_CWR || 2521 (tp->undo_marker && tp->snd_ssthresh < TCP_INFINITE_SSTHRESH)) { 2522 tp->snd_cwnd = tp->snd_ssthresh; | 2387 tp->undo_marker = 0; 2388} 2389 2390static inline bool tcp_may_undo(const struct tcp_sock *tp) 2391{ 2392 return tp->undo_marker && (!tp->undo_retrans || tcp_packet_delayed(tp)); 2393} 2394 --- 120 unchanged lines hidden (view full) --- 2515 2516 if (inet_csk(sk)->icsk_ca_ops->cong_control) 2517 return; 2518 2519 /* Reset cwnd to ssthresh in CWR or Recovery (unless it's undone) */ 2520 if (inet_csk(sk)->icsk_ca_state == TCP_CA_CWR || 2521 (tp->undo_marker && tp->snd_ssthresh < TCP_INFINITE_SSTHRESH)) { 2522 tp->snd_cwnd = tp->snd_ssthresh; |
2523 tp->snd_cwnd_stamp = tcp_time_stamp; | 2523 tp->snd_cwnd_stamp = tcp_jiffies32; |
2524 } 2525 tcp_ca_event(sk, CA_EVENT_COMPLETE_CWR); 2526} 2527 2528/* Enter CWR state. Disable cwnd undo since congestion is proven with ECN */ 2529void tcp_enter_cwr(struct sock *sk) 2530{ 2531 struct tcp_sock *tp = tcp_sk(sk); --- 53 unchanged lines hidden (view full) --- 2585 struct inet_connection_sock *icsk = inet_csk(sk); 2586 2587 /* FIXME: breaks with very large cwnd */ 2588 tp->prior_ssthresh = tcp_current_ssthresh(sk); 2589 tp->snd_cwnd = tp->snd_cwnd * 2590 tcp_mss_to_mtu(sk, tp->mss_cache) / 2591 icsk->icsk_mtup.probe_size; 2592 tp->snd_cwnd_cnt = 0; | 2524 } 2525 tcp_ca_event(sk, CA_EVENT_COMPLETE_CWR); 2526} 2527 2528/* Enter CWR state. Disable cwnd undo since congestion is proven with ECN */ 2529void tcp_enter_cwr(struct sock *sk) 2530{ 2531 struct tcp_sock *tp = tcp_sk(sk); --- 53 unchanged lines hidden (view full) --- 2585 struct inet_connection_sock *icsk = inet_csk(sk); 2586 2587 /* FIXME: breaks with very large cwnd */ 2588 tp->prior_ssthresh = tcp_current_ssthresh(sk); 2589 tp->snd_cwnd = tp->snd_cwnd * 2590 tcp_mss_to_mtu(sk, tp->mss_cache) / 2591 icsk->icsk_mtup.probe_size; 2592 tp->snd_cwnd_cnt = 0; |
2593 tp->snd_cwnd_stamp = tcp_time_stamp; | 2593 tp->snd_cwnd_stamp = tcp_jiffies32; |
2594 tp->snd_ssthresh = tcp_current_ssthresh(sk); 2595 2596 icsk->icsk_mtup.search_low = icsk->icsk_mtup.probe_size; 2597 icsk->icsk_mtup.probe_size = 0; 2598 tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); 2599 NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMTUPSUCCESS); 2600} 2601 --- 369 unchanged lines hidden (view full) --- 2971} 2972 2973 2974static void tcp_cong_avoid(struct sock *sk, u32 ack, u32 acked) 2975{ 2976 const struct inet_connection_sock *icsk = inet_csk(sk); 2977 2978 icsk->icsk_ca_ops->cong_avoid(sk, ack, acked); | 2594 tp->snd_ssthresh = tcp_current_ssthresh(sk); 2595 2596 icsk->icsk_mtup.search_low = icsk->icsk_mtup.probe_size; 2597 icsk->icsk_mtup.probe_size = 0; 2598 tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); 2599 NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMTUPSUCCESS); 2600} 2601 --- 369 unchanged lines hidden (view full) --- 2971} 2972 2973 2974static void tcp_cong_avoid(struct sock *sk, u32 ack, u32 acked) 2975{ 2976 const struct inet_connection_sock *icsk = inet_csk(sk); 2977 2978 icsk->icsk_ca_ops->cong_avoid(sk, ack, acked); |
2979 tcp_sk(sk)->snd_cwnd_stamp = tcp_time_stamp; | 2979 tcp_sk(sk)->snd_cwnd_stamp = tcp_jiffies32; |
2980} 2981 2982/* Restart timer after forward progress on connection. 2983 * RFC2988 recommends to restart timer to now+rto. 2984 */ 2985void tcp_rearm_rto(struct sock *sk) 2986{ 2987 const struct inet_connection_sock *icsk = inet_csk(sk); --- 2026 unchanged lines hidden (view full) --- 5014 * PROBLEM: sndbuf expansion does not work well with largesend. 5015 */ 5016static void tcp_new_space(struct sock *sk) 5017{ 5018 struct tcp_sock *tp = tcp_sk(sk); 5019 5020 if (tcp_should_expand_sndbuf(sk)) { 5021 tcp_sndbuf_expand(sk); | 2980} 2981 2982/* Restart timer after forward progress on connection. 2983 * RFC2988 recommends to restart timer to now+rto. 2984 */ 2985void tcp_rearm_rto(struct sock *sk) 2986{ 2987 const struct inet_connection_sock *icsk = inet_csk(sk); --- 2026 unchanged lines hidden (view full) --- 5014 * PROBLEM: sndbuf expansion does not work well with largesend. 5015 */ 5016static void tcp_new_space(struct sock *sk) 5017{ 5018 struct tcp_sock *tp = tcp_sk(sk); 5019 5020 if (tcp_should_expand_sndbuf(sk)) { 5021 tcp_sndbuf_expand(sk); |
5022 tp->snd_cwnd_stamp = tcp_time_stamp; | 5022 tp->snd_cwnd_stamp = tcp_jiffies32; |
5023 } 5024 5025 sk->sk_write_space(sk); 5026} 5027 5028static void tcp_check_space(struct sock *sk) 5029{ 5030 if (sock_flag(sk, SOCK_QUEUE_SHRUNK)) { --- 1396 unchanged lines hidden --- | 5023 } 5024 5025 sk->sk_write_space(sk); 5026} 5027 5028static void tcp_check_space(struct sock *sk) 5029{ 5030 if (sock_flag(sk, SOCK_QUEUE_SHRUNK)) { --- 1396 unchanged lines hidden --- |