aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>2007-04-21 01:56:38 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:47:50 -0400
commitd8f4f2235abc7b30cf447ca3e22ac28326b12f28 (patch)
tree1f408031fd56c06f2321fa7a6fe5bc8a5ff729fe /net/ipv4/tcp_input.c
parentd738cd8fca948e45d53120247cb7a5f5be3ca09e (diff)
[TCP]: Extracted rexmit hint clearing from the LOST marking code
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 813f2049b85d..7d843c429381 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1765,6 +1765,20 @@ static inline void tcp_reset_reno_sack(struct tcp_sock *tp)
1765 tp->left_out = tp->lost_out; 1765 tp->left_out = tp->lost_out;
1766} 1766}
1767 1767
1768/* RFC: This is from the original, I doubt that this is necessary at all:
1769 * clear xmit_retrans hint if seq of this skb is beyond hint. How could we
1770 * retransmitted past LOST markings in the first place? I'm not fully sure
1771 * about undo and end of connection cases, which can cause R without L?
1772 */
1773static void tcp_verify_retransmit_hint(struct tcp_sock *tp,
1774 struct sk_buff *skb)
1775{
1776 if ((tp->retransmit_skb_hint != NULL) &&
1777 before(TCP_SKB_CB(skb)->seq,
1778 TCP_SKB_CB(tp->retransmit_skb_hint)->seq))
1779 tp->retransmit_skb_hint = skb;
1780}
1781
1768/* Mark head of queue up as lost. */ 1782/* Mark head of queue up as lost. */
1769static void tcp_mark_head_lost(struct sock *sk, 1783static void tcp_mark_head_lost(struct sock *sk,
1770 int packets, u32 high_seq) 1784 int packets, u32 high_seq)
@@ -1795,14 +1809,7 @@ static void tcp_mark_head_lost(struct sock *sk,
1795 if (!(TCP_SKB_CB(skb)->sacked&TCPCB_TAGBITS)) { 1809 if (!(TCP_SKB_CB(skb)->sacked&TCPCB_TAGBITS)) {
1796 TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; 1810 TCP_SKB_CB(skb)->sacked |= TCPCB_LOST;
1797 tp->lost_out += tcp_skb_pcount(skb); 1811 tp->lost_out += tcp_skb_pcount(skb);
1798 1812 tcp_verify_retransmit_hint(tp, skb);
1799 /* clear xmit_retransmit_queue hints
1800 * if this is beyond hint */
1801 if (tp->retransmit_skb_hint != NULL &&
1802 before(TCP_SKB_CB(skb)->seq,
1803 TCP_SKB_CB(tp->retransmit_skb_hint)->seq))
1804 tp->retransmit_skb_hint = NULL;
1805
1806 } 1813 }
1807 } 1814 }
1808 tcp_sync_left_out(tp); 1815 tcp_sync_left_out(tp);
@@ -1843,13 +1850,7 @@ static void tcp_update_scoreboard(struct sock *sk)
1843 if (!(TCP_SKB_CB(skb)->sacked&TCPCB_TAGBITS)) { 1850 if (!(TCP_SKB_CB(skb)->sacked&TCPCB_TAGBITS)) {
1844 TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; 1851 TCP_SKB_CB(skb)->sacked |= TCPCB_LOST;
1845 tp->lost_out += tcp_skb_pcount(skb); 1852 tp->lost_out += tcp_skb_pcount(skb);
1846 1853 tcp_verify_retransmit_hint(tp, skb);
1847 /* clear xmit_retrans hint */
1848 if (tp->retransmit_skb_hint &&
1849 before(TCP_SKB_CB(skb)->seq,
1850 TCP_SKB_CB(tp->retransmit_skb_hint)->seq))
1851
1852 tp->retransmit_skb_hint = NULL;
1853 } 1854 }
1854 } 1855 }
1855 1856