Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3e6f049e0c4cf0606207c1a210abf50b436e9adf
Commit:     3e6f049e0c4cf0606207c1a210abf50b436e9adf
Parent:     92b05e13f16a41405c4f6c953c47b6c4bcf82d30
Author:     Ilpo J�rvinen <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 5 02:20:21 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Dec 5 05:37:29 2007 -0800

    [TCP] FRTO: Use of existing funcs make code more obvious & robust
    
    Though there's little need for everything that tcp_may_send_now
    does (actually, even the state had to be adjusted to pass some
    checks FRTO does not want to occur), it's more robust to let it
    make the decision if sending is allowed. State adjustments
    needed:
    - Make sure snd_cwnd limit is not hit in there
    - Disable nagle (if necessary) through the frto_counter == 2
    
    The result of check for frto_counter in argument to call for
    tcp_enter_frto_loss can just be open coded, therefore there
    isn't need to store the previous frto_counter past
    tcp_may_send_now.
    
    In addition, returns can then be combined.
    
    Signed-off-by: Ilpo J�rvinen <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/tcp_input.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 0f0c1c9..094f8fa 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3003,17 +3003,13 @@ static int tcp_process_frto(struct sock *sk, int flag)
        }
 
        if (tp->frto_counter == 1) {
-               /* Sending of the next skb must be allowed or no F-RTO */
-               if (!tcp_send_head(sk) ||
-                   after(TCP_SKB_CB(tcp_send_head(sk))->end_seq,
-                                    tp->snd_una + tp->snd_wnd)) {
-                       tcp_enter_frto_loss(sk, (tp->frto_counter == 1 ? 2 : 3),
-                                           flag);
-                       return 1;
-               }
-
+               /* tcp_may_send_now needs to see updated state */
                tp->snd_cwnd = tcp_packets_in_flight(tp) + 2;
                tp->frto_counter = 2;
+
+               if (!tcp_may_send_now(sk))
+                       tcp_enter_frto_loss(sk, 2, flag);
+
                return 1;
        } else {
                switch (sysctl_tcp_frto_response) {
-
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