diff options
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index edaaebfbcd46..568dbf3b711a 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -4269,7 +4269,7 @@ static void tcp_sack_new_ofo_skb(struct sock *sk, u32 seq, u32 end_seq) | |||
4269 | * If the sack array is full, forget about the last one. | 4269 | * If the sack array is full, forget about the last one. |
4270 | */ | 4270 | */ |
4271 | if (this_sack >= TCP_NUM_SACKS) { | 4271 | if (this_sack >= TCP_NUM_SACKS) { |
4272 | if (tp->compressed_ack) | 4272 | if (tp->compressed_ack > TCP_FASTRETRANS_THRESH) |
4273 | tcp_send_ack(sk); | 4273 | tcp_send_ack(sk); |
4274 | this_sack--; | 4274 | this_sack--; |
4275 | tp->rx_opt.num_sacks--; | 4275 | tp->rx_opt.num_sacks--; |
@@ -4364,6 +4364,7 @@ static bool tcp_try_coalesce(struct sock *sk, | |||
4364 | if (TCP_SKB_CB(from)->has_rxtstamp) { | 4364 | if (TCP_SKB_CB(from)->has_rxtstamp) { |
4365 | TCP_SKB_CB(to)->has_rxtstamp = true; | 4365 | TCP_SKB_CB(to)->has_rxtstamp = true; |
4366 | to->tstamp = from->tstamp; | 4366 | to->tstamp = from->tstamp; |
4367 | skb_hwtstamps(to)->hwtstamp = skb_hwtstamps(from)->hwtstamp; | ||
4367 | } | 4368 | } |
4368 | 4369 | ||
4369 | return true; | 4370 | return true; |
@@ -5189,7 +5190,17 @@ send_now: | |||
5189 | if (!tcp_is_sack(tp) || | 5190 | if (!tcp_is_sack(tp) || |
5190 | tp->compressed_ack >= sock_net(sk)->ipv4.sysctl_tcp_comp_sack_nr) | 5191 | tp->compressed_ack >= sock_net(sk)->ipv4.sysctl_tcp_comp_sack_nr) |
5191 | goto send_now; | 5192 | goto send_now; |
5192 | tp->compressed_ack++; | 5193 | |
5194 | if (tp->compressed_ack_rcv_nxt != tp->rcv_nxt) { | ||
5195 | tp->compressed_ack_rcv_nxt = tp->rcv_nxt; | ||
5196 | if (tp->compressed_ack > TCP_FASTRETRANS_THRESH) | ||
5197 | NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPACKCOMPRESSED, | ||
5198 | tp->compressed_ack - TCP_FASTRETRANS_THRESH); | ||
5199 | tp->compressed_ack = 0; | ||
5200 | } | ||
5201 | |||
5202 | if (++tp->compressed_ack <= TCP_FASTRETRANS_THRESH) | ||
5203 | goto send_now; | ||
5193 | 5204 | ||
5194 | if (hrtimer_is_queued(&tp->compressed_ack_timer)) | 5205 | if (hrtimer_is_queued(&tp->compressed_ack_timer)) |
5195 | return; | 5206 | return; |