aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2017-10-06 01:21:24 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-06 19:28:53 -0400
commit5e76ee4b8e90384936a214cde5b7816424f70232 (patch)
tree24d8072eb5d33600fd67ab24ffa4f3706ee390d8 /net/ipv4/tcp_input.c
parent4e8cc22803080853a33bafc6748e133448fb8182 (diff)
tcp: tcp_mark_head_lost() optimization
It will be a bit more expensive to get the head of rtx queue once rtx queue is converted to an rb-tree. We can avoid this extra cost in case tp->lost_skb_hint is set. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 90afe4143596..abc3b1db81f8 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2207,12 +2207,12 @@ static void tcp_mark_head_lost(struct sock *sk, int packets, int mark_head)
2207 const u32 loss_high = tcp_is_sack(tp) ? tp->snd_nxt : tp->high_seq; 2207 const u32 loss_high = tcp_is_sack(tp) ? tp->snd_nxt : tp->high_seq;
2208 2208
2209 WARN_ON(packets > tp->packets_out); 2209 WARN_ON(packets > tp->packets_out);
2210 if (tp->lost_skb_hint) { 2210 skb = tp->lost_skb_hint;
2211 skb = tp->lost_skb_hint; 2211 if (skb) {
2212 cnt = tp->lost_cnt_hint;
2213 /* Head already handled? */ 2212 /* Head already handled? */
2214 if (mark_head && skb != tcp_write_queue_head(sk)) 2213 if (mark_head && after(TCP_SKB_CB(skb)->seq, tp->snd_una))
2215 return; 2214 return;
2215 cnt = tp->lost_cnt_hint;
2216 } else { 2216 } else {
2217 skb = tcp_write_queue_head(sk); 2217 skb = tcp_write_queue_head(sk);
2218 cnt = 0; 2218 cnt = 0;