Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=83ae40885f33e406c87c86b0bd4b6fd31a741f12
Commit:     83ae40885f33e406c87c86b0bd4b6fd31a741f12
Parent:     b5860bbac7be1381626f3dc8a0cb970a60fcefb4
Author:     Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Thu Aug 9 14:37:30 2007 +0300
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:47:56 2007 -0700

    [TCP]: Add tcp_left_out(tp) "back" to get cleaner looking lines
    
    tp->left_out got removed but nothing came to replace it back
    then (users just did addition by themselves), so add function
    for users now.
    
    Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/net/tcp.h    |   11 +++++++----
 net/ipv4/tcp_input.c |    2 +-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 299872d..39d0df6 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -719,6 +719,11 @@ static inline void tcp_ca_event(struct sock *sk, const 
enum tcp_ca_event event)
                icsk->icsk_ca_ops->cwnd_event(sk, event);
 }
 
+static inline unsigned int tcp_left_out(const struct tcp_sock *tp)
+{
+       return tp->sacked_out + tp->lost_out;
+}
+
 /* This determines how many packets are "in the network" to the best
  * of our knowledge.  In many cases it is conservative, but where
  * detailed information is available from the receiver (via SACK
@@ -735,8 +740,7 @@ static inline void tcp_ca_event(struct sock *sk, const enum 
tcp_ca_event event)
  */
 static inline unsigned int tcp_packets_in_flight(const struct tcp_sock *tp)
 {
-       return tp->packets_out - (tp->sacked_out + tp->lost_out) +
-               tp->retrans_out;
+       return tp->packets_out - tcp_left_out(tp) + tp->retrans_out;
 }
 
 /* If cwnd > ssthresh, we may raise ssthresh to be half-way to cwnd.
@@ -756,8 +760,7 @@ static inline __u32 tcp_current_ssthresh(const struct sock 
*sk)
 
 static inline void tcp_sync_left_out(struct tcp_sock *tp)
 {
-       BUG_ON(tp->rx_opt.sack_ok &&
-              (tp->sacked_out + tp->lost_out > tp->packets_out));
+       BUG_ON(tp->rx_opt.sack_ok && (tcp_left_out(tp) > tp->packets_out));
 }
 
 extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 957e0fb..6bdd053 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1969,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->sacked_out + tp->lost_out,
+              tp->snd_cwnd, tcp_left_out(tp),
               tp->snd_ssthresh, tp->prior_ssthresh,
               tp->packets_out);
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to