|
@@ -4461,6 +4461,12 @@ coalesce_done:
|
|
skb = NULL;
|
|
skb = NULL;
|
|
goto add_sack;
|
|
goto add_sack;
|
|
}
|
|
}
|
|
|
|
+ /* Can avoid an rbtree lookup if we are adding skb after ooo_last_skb */
|
|
|
|
+ if (!before(seq, TCP_SKB_CB(tp->ooo_last_skb)->end_seq)) {
|
|
|
|
+ parent = &tp->ooo_last_skb->rbnode;
|
|
|
|
+ p = &parent->rb_right;
|
|
|
|
+ goto insert;
|
|
|
|
+ }
|
|
|
|
|
|
/* Find place to insert this segment. Handle overlaps on the way. */
|
|
/* Find place to insert this segment. Handle overlaps on the way. */
|
|
parent = NULL;
|
|
parent = NULL;
|
|
@@ -4503,7 +4509,7 @@ coalesce_done:
|
|
}
|
|
}
|
|
p = &parent->rb_right;
|
|
p = &parent->rb_right;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+insert:
|
|
/* Insert segment into RB tree. */
|
|
/* Insert segment into RB tree. */
|
|
rb_link_node(&skb->rbnode, parent, p);
|
|
rb_link_node(&skb->rbnode, parent, p);
|
|
rb_insert_color(&skb->rbnode, &tp->out_of_order_queue);
|
|
rb_insert_color(&skb->rbnode, &tp->out_of_order_queue);
|