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>
This commit is contained in:
committed by
David S. Miller
parent
4e8cc22803
commit
5e76ee4b8e
@@ -2207,12 +2207,12 @@ static void tcp_mark_head_lost(struct sock *sk, int packets, int mark_head)
|
|||||||
const u32 loss_high = tcp_is_sack(tp) ? tp->snd_nxt : tp->high_seq;
|
const u32 loss_high = tcp_is_sack(tp) ? tp->snd_nxt : tp->high_seq;
|
||||||
|
|
||||||
WARN_ON(packets > tp->packets_out);
|
WARN_ON(packets > tp->packets_out);
|
||||||
if (tp->lost_skb_hint) {
|
skb = tp->lost_skb_hint;
|
||||||
skb = tp->lost_skb_hint;
|
if (skb) {
|
||||||
cnt = tp->lost_cnt_hint;
|
|
||||||
/* Head already handled? */
|
/* Head already handled? */
|
||||||
if (mark_head && skb != tcp_write_queue_head(sk))
|
if (mark_head && after(TCP_SKB_CB(skb)->seq, tp->snd_una))
|
||||||
return;
|
return;
|
||||||
|
cnt = tp->lost_cnt_hint;
|
||||||
} else {
|
} else {
|
||||||
skb = tcp_write_queue_head(sk);
|
skb = tcp_write_queue_head(sk);
|
||||||
cnt = 0;
|
cnt = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user