]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/tcp_input.c
[TCP]: Left out sync->verify (the new meaning of it) & definify
[linux-2.6-omap-h63xx.git] / net / ipv4 / tcp_input.c
index ea690afa592a9e8b7e6531058aa3e0ae0cc1cce9..b11bd162422725777e9116e9288e25f15fadb538 100644 (file)
@@ -1346,8 +1346,6 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
                }
        }
 
-       tp->left_out = tp->sacked_out + tp->lost_out;
-
        if ((reord < tp->fackets_out) && icsk->icsk_ca_state != TCP_CA_Loss &&
            (!tp->frto_highmark || after(tp->snd_una, tp->frto_highmark)))
                tcp_update_reordering(sk, ((tp->fackets_out + 1) - reord), 0);
@@ -1385,7 +1383,7 @@ static void tcp_add_reno_sack(struct sock *sk)
        struct tcp_sock *tp = tcp_sk(sk);
        tp->sacked_out++;
        tcp_check_reno_reordering(sk, 0);
-       tcp_sync_left_out(tp);
+       tcp_verify_left_out(tp);
 }
 
 /* Account for ACK, ACKing some data in Reno Recovery phase. */
@@ -1402,13 +1400,12 @@ static void tcp_remove_reno_sacks(struct sock *sk, int acked)
                        tp->sacked_out -= acked-1;
        }
        tcp_check_reno_reordering(sk, acked);
-       tcp_sync_left_out(tp);
+       tcp_verify_left_out(tp);
 }
 
 static inline void tcp_reset_reno_sack(struct tcp_sock *tp)
 {
        tp->sacked_out = 0;
-       tp->left_out = tp->lost_out;
 }
 
 int tcp_use_frto(struct sock *sk)
@@ -1499,7 +1496,7 @@ void tcp_enter_frto(struct sock *sk)
                TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS;
                tp->retrans_out -= tcp_skb_pcount(skb);
        }
-       tcp_sync_left_out(tp);
+       tcp_verify_left_out(tp);
 
        /* Earlier loss recovery underway (see RFC4138; Appendix B).
         * The last condition is necessary at least in tp->frto_counter case.
@@ -1554,7 +1551,7 @@ static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int flag)
                        tp->lost_out += tcp_skb_pcount(skb);
                }
        }
-       tcp_sync_left_out(tp);
+       tcp_verify_left_out(tp);
 
        tp->snd_cwnd = tcp_packets_in_flight(tp) + allowed_segments;
        tp->snd_cwnd_cnt = 0;
@@ -1573,7 +1570,6 @@ static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int flag)
 
 void tcp_clear_retrans(struct tcp_sock *tp)
 {
-       tp->left_out = 0;
        tp->retrans_out = 0;
 
        tp->fackets_out = 0;
@@ -1630,7 +1626,7 @@ void tcp_enter_loss(struct sock *sk, int how)
                        tp->fackets_out = cnt;
                }
        }
-       tcp_sync_left_out(tp);
+       tcp_verify_left_out(tp);
 
        tp->reordering = min_t(unsigned int, tp->reordering,
                                             sysctl_tcp_reordering);
@@ -1865,7 +1861,7 @@ static void tcp_mark_head_lost(struct sock *sk,
                        tcp_verify_retransmit_hint(tp, skb);
                }
        }
-       tcp_sync_left_out(tp);
+       tcp_verify_left_out(tp);
 }
 
 /* Account newly detected lost packet(s) */
@@ -1909,7 +1905,7 @@ static void tcp_update_scoreboard(struct sock *sk)
 
                tp->scoreboard_skb_hint = skb;
 
-               tcp_sync_left_out(tp);
+               tcp_verify_left_out(tp);
        }
 }
 
@@ -1973,7 +1969,7 @@ static void DBGUNDO(struct sock *sk, const char *msg)
        printk(KERN_DEBUG "Undo %s %u.%u.%u.%u/%u c%u l%u ss%u/%u p%u\n",
               msg,
               NIPQUAD(inet->daddr), ntohs(inet->dport),
-              tp->snd_cwnd, tp->left_out,
+              tp->snd_cwnd, tcp_left_out(tp),
               tp->snd_ssthresh, tp->prior_ssthresh,
               tp->packets_out);
 }
@@ -2102,7 +2098,6 @@ static int tcp_try_undo_loss(struct sock *sk)
 
                DBGUNDO(sk, "partial loss");
                tp->lost_out = 0;
-               tp->left_out = tp->sacked_out;
                tcp_undo_cwr(sk, 1);
                NET_INC_STATS_BH(LINUX_MIB_TCPLOSSUNDO);
                inet_csk(sk)->icsk_retransmits = 0;
@@ -2126,8 +2121,6 @@ static void tcp_try_to_open(struct sock *sk, int flag)
 {
        struct tcp_sock *tp = tcp_sk(sk);
 
-       tcp_sync_left_out(tp);
-
        if (tp->retrans_out == 0)
                tp->retrans_stamp = 0;
 
@@ -2137,7 +2130,7 @@ static void tcp_try_to_open(struct sock *sk, int flag)
        if (inet_csk(sk)->icsk_ca_state != TCP_CA_CWR) {
                int state = TCP_CA_Open;
 
-               if (tp->left_out || tp->retrans_out || tp->undo_marker)
+               if (tp->sacked_out || tp->retrans_out || tp->undo_marker)
                        state = TCP_CA_Disorder;
 
                if (inet_csk(sk)->icsk_ca_state != state) {
@@ -2224,8 +2217,8 @@ tcp_fastretrans_alert(struct sock *sk, int prior_packets, int flag)
                NET_INC_STATS_BH(LINUX_MIB_TCPLOSS);
        }
 
-       /* D. Synchronize left_out to current state. */
-       tcp_sync_left_out(tp);
+       /* D. Check consistency of the current state. */
+       tcp_verify_left_out(tp);
 
        /* E. Check state exit conditions. State can be terminated
         *    when high_seq is ACKed. */
@@ -2772,7 +2765,7 @@ static int tcp_process_frto(struct sock *sk, int flag)
 {
        struct tcp_sock *tp = tcp_sk(sk);
 
-       tcp_sync_left_out(tp);
+       tcp_verify_left_out(tp);
 
        /* Duplicate the behavior from Loss state (fastretrans_alert) */
        if (flag&FLAG_DATA_ACKED)