diff options
Diffstat (limited to 'net/ipv4/tcp_input.c')
| -rw-r--r-- | net/ipv4/tcp_input.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 0cbb44076cfa..2877c3e09587 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
| @@ -322,7 +322,7 @@ static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb) | |||
| 322 | /* Check #1 */ | 322 | /* Check #1 */ |
| 323 | if (tp->rcv_ssthresh < tp->window_clamp && | 323 | if (tp->rcv_ssthresh < tp->window_clamp && |
| 324 | (int)tp->rcv_ssthresh < tcp_space(sk) && | 324 | (int)tp->rcv_ssthresh < tcp_space(sk) && |
| 325 | !tcp_memory_pressure) { | 325 | !sk_under_memory_pressure(sk)) { |
| 326 | int incr; | 326 | int incr; |
| 327 | 327 | ||
| 328 | /* Check #2. Increase window, if skb with such overhead | 328 | /* Check #2. Increase window, if skb with such overhead |
| @@ -411,8 +411,8 @@ static void tcp_clamp_window(struct sock *sk) | |||
| 411 | 411 | ||
| 412 | if (sk->sk_rcvbuf < sysctl_tcp_rmem[2] && | 412 | if (sk->sk_rcvbuf < sysctl_tcp_rmem[2] && |
| 413 | !(sk->sk_userlocks & SOCK_RCVBUF_LOCK) && | 413 | !(sk->sk_userlocks & SOCK_RCVBUF_LOCK) && |
| 414 | !tcp_memory_pressure && | 414 | !sk_under_memory_pressure(sk) && |
| 415 | atomic_long_read(&tcp_memory_allocated) < sysctl_tcp_mem[0]) { | 415 | sk_memory_allocated(sk) < sk_prot_mem_limits(sk, 0)) { |
| 416 | sk->sk_rcvbuf = min(atomic_read(&sk->sk_rmem_alloc), | 416 | sk->sk_rcvbuf = min(atomic_read(&sk->sk_rmem_alloc), |
| 417 | sysctl_tcp_rmem[2]); | 417 | sysctl_tcp_rmem[2]); |
| 418 | } | 418 | } |
| @@ -865,13 +865,13 @@ static void tcp_disable_fack(struct tcp_sock *tp) | |||
| 865 | /* RFC3517 uses different metric in lost marker => reset on change */ | 865 | /* RFC3517 uses different metric in lost marker => reset on change */ |
| 866 | if (tcp_is_fack(tp)) | 866 | if (tcp_is_fack(tp)) |
| 867 | tp->lost_skb_hint = NULL; | 867 | tp->lost_skb_hint = NULL; |
| 868 | tp->rx_opt.sack_ok &= ~2; | 868 | tp->rx_opt.sack_ok &= ~TCP_FACK_ENABLED; |
| 869 | } | 869 | } |
| 870 | 870 | ||
| 871 | /* Take a notice that peer is sending D-SACKs */ | 871 | /* Take a notice that peer is sending D-SACKs */ |
| 872 | static void tcp_dsack_seen(struct tcp_sock *tp) | 872 | static void tcp_dsack_seen(struct tcp_sock *tp) |
| 873 | { | 873 | { |
| 874 | tp->rx_opt.sack_ok |= 4; | 874 | tp->rx_opt.sack_ok |= TCP_DSACK_SEEN; |
| 875 | } | 875 | } |
| 876 | 876 | ||
| 877 | /* Initialize metrics on socket. */ | 877 | /* Initialize metrics on socket. */ |
| @@ -2663,7 +2663,7 @@ static void DBGUNDO(struct sock *sk, const char *msg) | |||
| 2663 | tp->snd_ssthresh, tp->prior_ssthresh, | 2663 | tp->snd_ssthresh, tp->prior_ssthresh, |
| 2664 | tp->packets_out); | 2664 | tp->packets_out); |
| 2665 | } | 2665 | } |
| 2666 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 2666 | #if IS_ENABLED(CONFIG_IPV6) |
| 2667 | else if (sk->sk_family == AF_INET6) { | 2667 | else if (sk->sk_family == AF_INET6) { |
| 2668 | struct ipv6_pinfo *np = inet6_sk(sk); | 2668 | struct ipv6_pinfo *np = inet6_sk(sk); |
| 2669 | printk(KERN_DEBUG "Undo %s %pI6/%u c%u l%u ss%u/%u p%u\n", | 2669 | printk(KERN_DEBUG "Undo %s %pI6/%u c%u l%u ss%u/%u p%u\n", |
| @@ -3878,7 +3878,7 @@ void tcp_parse_options(const struct sk_buff *skb, struct tcp_options_received *o | |||
| 3878 | case TCPOPT_SACK_PERM: | 3878 | case TCPOPT_SACK_PERM: |
| 3879 | if (opsize == TCPOLEN_SACK_PERM && th->syn && | 3879 | if (opsize == TCPOLEN_SACK_PERM && th->syn && |
| 3880 | !estab && sysctl_tcp_sack) { | 3880 | !estab && sysctl_tcp_sack) { |
| 3881 | opt_rx->sack_ok = 1; | 3881 | opt_rx->sack_ok = TCP_SACK_SEEN; |
| 3882 | tcp_sack_reset(opt_rx); | 3882 | tcp_sack_reset(opt_rx); |
| 3883 | } | 3883 | } |
| 3884 | break; | 3884 | break; |
| @@ -4866,7 +4866,7 @@ static int tcp_prune_queue(struct sock *sk) | |||
| 4866 | 4866 | ||
| 4867 | if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) | 4867 | if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) |
| 4868 | tcp_clamp_window(sk); | 4868 | tcp_clamp_window(sk); |
| 4869 | else if (tcp_memory_pressure) | 4869 | else if (sk_under_memory_pressure(sk)) |
| 4870 | tp->rcv_ssthresh = min(tp->rcv_ssthresh, 4U * tp->advmss); | 4870 | tp->rcv_ssthresh = min(tp->rcv_ssthresh, 4U * tp->advmss); |
| 4871 | 4871 | ||
| 4872 | tcp_collapse_ofo_queue(sk); | 4872 | tcp_collapse_ofo_queue(sk); |
| @@ -4932,11 +4932,11 @@ static int tcp_should_expand_sndbuf(const struct sock *sk) | |||
| 4932 | return 0; | 4932 | return 0; |
| 4933 | 4933 | ||
| 4934 | /* If we are under global TCP memory pressure, do not expand. */ | 4934 | /* If we are under global TCP memory pressure, do not expand. */ |
| 4935 | if (tcp_memory_pressure) | 4935 | if (sk_under_memory_pressure(sk)) |
| 4936 | return 0; | 4936 | return 0; |
| 4937 | 4937 | ||
| 4938 | /* If we are under soft global TCP memory pressure, do not expand. */ | 4938 | /* If we are under soft global TCP memory pressure, do not expand. */ |
| 4939 | if (atomic_long_read(&tcp_memory_allocated) >= sysctl_tcp_mem[0]) | 4939 | if (sk_memory_allocated(sk) >= sk_prot_mem_limits(sk, 0)) |
| 4940 | return 0; | 4940 | return 0; |
| 4941 | 4941 | ||
| 4942 | /* If we filled the congestion window, do not expand. */ | 4942 | /* If we filled the congestion window, do not expand. */ |
