diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ip_tunnel_core.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 15 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 6 | ||||
-rw-r--r-- | net/ipv4/tcp_timer.c | 2 |
4 files changed, 18 insertions, 7 deletions
diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c index dde671e97829..c248e0dccbe1 100644 --- a/net/ipv4/ip_tunnel_core.c +++ b/net/ipv4/ip_tunnel_core.c | |||
@@ -80,7 +80,7 @@ void iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb, | |||
80 | 80 | ||
81 | iph->version = 4; | 81 | iph->version = 4; |
82 | iph->ihl = sizeof(struct iphdr) >> 2; | 82 | iph->ihl = sizeof(struct iphdr) >> 2; |
83 | iph->frag_off = df; | 83 | iph->frag_off = ip_mtu_locked(&rt->dst) ? 0 : df; |
84 | iph->protocol = proto; | 84 | iph->protocol = proto; |
85 | iph->tos = tos; | 85 | iph->tos = tos; |
86 | iph->daddr = dst; | 86 | iph->daddr = dst; |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 2868ef28ce52..1e37c1388189 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -4268,7 +4268,7 @@ static void tcp_sack_new_ofo_skb(struct sock *sk, u32 seq, u32 end_seq) | |||
4268 | * If the sack array is full, forget about the last one. | 4268 | * If the sack array is full, forget about the last one. |
4269 | */ | 4269 | */ |
4270 | if (this_sack >= TCP_NUM_SACKS) { | 4270 | if (this_sack >= TCP_NUM_SACKS) { |
4271 | if (tp->compressed_ack) | 4271 | if (tp->compressed_ack > TCP_FASTRETRANS_THRESH) |
4272 | tcp_send_ack(sk); | 4272 | tcp_send_ack(sk); |
4273 | this_sack--; | 4273 | this_sack--; |
4274 | tp->rx_opt.num_sacks--; | 4274 | tp->rx_opt.num_sacks--; |
@@ -4363,6 +4363,7 @@ static bool tcp_try_coalesce(struct sock *sk, | |||
4363 | if (TCP_SKB_CB(from)->has_rxtstamp) { | 4363 | if (TCP_SKB_CB(from)->has_rxtstamp) { |
4364 | TCP_SKB_CB(to)->has_rxtstamp = true; | 4364 | TCP_SKB_CB(to)->has_rxtstamp = true; |
4365 | to->tstamp = from->tstamp; | 4365 | to->tstamp = from->tstamp; |
4366 | skb_hwtstamps(to)->hwtstamp = skb_hwtstamps(from)->hwtstamp; | ||
4366 | } | 4367 | } |
4367 | 4368 | ||
4368 | return true; | 4369 | return true; |
@@ -5188,7 +5189,17 @@ send_now: | |||
5188 | if (!tcp_is_sack(tp) || | 5189 | if (!tcp_is_sack(tp) || |
5189 | tp->compressed_ack >= sock_net(sk)->ipv4.sysctl_tcp_comp_sack_nr) | 5190 | tp->compressed_ack >= sock_net(sk)->ipv4.sysctl_tcp_comp_sack_nr) |
5190 | goto send_now; | 5191 | goto send_now; |
5191 | tp->compressed_ack++; | 5192 | |
5193 | if (tp->compressed_ack_rcv_nxt != tp->rcv_nxt) { | ||
5194 | tp->compressed_ack_rcv_nxt = tp->rcv_nxt; | ||
5195 | if (tp->compressed_ack > TCP_FASTRETRANS_THRESH) | ||
5196 | NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPACKCOMPRESSED, | ||
5197 | tp->compressed_ack - TCP_FASTRETRANS_THRESH); | ||
5198 | tp->compressed_ack = 0; | ||
5199 | } | ||
5200 | |||
5201 | if (++tp->compressed_ack <= TCP_FASTRETRANS_THRESH) | ||
5202 | goto send_now; | ||
5192 | 5203 | ||
5193 | if (hrtimer_is_queued(&tp->compressed_ack_timer)) | 5204 | if (hrtimer_is_queued(&tp->compressed_ack_timer)) |
5194 | return; | 5205 | return; |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 9c34b97d365d..3f510cad0b3e 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -180,10 +180,10 @@ static inline void tcp_event_ack_sent(struct sock *sk, unsigned int pkts, | |||
180 | { | 180 | { |
181 | struct tcp_sock *tp = tcp_sk(sk); | 181 | struct tcp_sock *tp = tcp_sk(sk); |
182 | 182 | ||
183 | if (unlikely(tp->compressed_ack)) { | 183 | if (unlikely(tp->compressed_ack > TCP_FASTRETRANS_THRESH)) { |
184 | NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPACKCOMPRESSED, | 184 | NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPACKCOMPRESSED, |
185 | tp->compressed_ack); | 185 | tp->compressed_ack - TCP_FASTRETRANS_THRESH); |
186 | tp->compressed_ack = 0; | 186 | tp->compressed_ack = TCP_FASTRETRANS_THRESH; |
187 | if (hrtimer_try_to_cancel(&tp->compressed_ack_timer) == 1) | 187 | if (hrtimer_try_to_cancel(&tp->compressed_ack_timer) == 1) |
188 | __sock_put(sk); | 188 | __sock_put(sk); |
189 | } | 189 | } |
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 676020663ce8..5f8b6d3cd855 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c | |||
@@ -740,7 +740,7 @@ static enum hrtimer_restart tcp_compressed_ack_kick(struct hrtimer *timer) | |||
740 | 740 | ||
741 | bh_lock_sock(sk); | 741 | bh_lock_sock(sk); |
742 | if (!sock_owned_by_user(sk)) { | 742 | if (!sock_owned_by_user(sk)) { |
743 | if (tp->compressed_ack) | 743 | if (tp->compressed_ack > TCP_FASTRETRANS_THRESH) |
744 | tcp_send_ack(sk); | 744 | tcp_send_ack(sk); |
745 | } else { | 745 | } else { |
746 | if (!test_and_set_bit(TCP_DELACK_TIMER_DEFERRED, | 746 | if (!test_and_set_bit(TCP_DELACK_TIMER_DEFERRED, |