netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.27] tcp_htcp: last_cong bug fix
@ 2008-11-09 19:09 Douglas Leith
  2008-11-10  3:56 ` Lawrence Stewart
  2008-11-11  5:50 ` David Miller
  0 siblings, 2 replies; 11+ messages in thread
From: Douglas Leith @ 2008-11-09 19:09 UTC (permalink / raw)
  To: Netdev; +Cc: Stephen Hemminger, Lachlan Andrew, Lawrence Stewart

This patch fixes a minor bug in tcp_htcp.c which has been highlighted  
by Lachlan Andrew and Lawrence Stewart.   Currently, the time since  
the last congestion event, which is stored in variable last_cong, is  
reset whenever there is a state change into TCP_CA_Open.  This  
includes transitions of the type TCP_CA_Open->TCP_CA_Disorder- 
 >TCP_CA_Open which are not associated with backoff of cwnd.  The  
patch changes last_cong to be updated only on transitions into  
TCP_CA_Open that occur after experiencing the congestion-related  
states TCP_CA_Loss, TCP_CA_Recovery, TCP_CA_CWR.

Doug

--- tcp_htcp.c   2008-11-05 15:50:18.000000000 +0000
+++ tcp_htcp.c.new       2008-11-08 07:11:18.000000000 +0000
@@ -69,9 +69,12 @@
         const struct tcp_sock *tp = tcp_sk(sk);
         struct htcp *ca = inet_csk_ca(sk);

-       ca->last_cong = ca->undo_last_cong;
-       ca->maxRTT = ca->undo_maxRTT;
-       ca->old_maxB = ca->undo_old_maxB;
+       if (ca->undo_last_cong) {
+               ca->last_cong = ca->undo_last_cong;
+               ca->maxRTT = ca->undo_maxRTT;
+               ca->old_maxB = ca->undo_old_maxB;
+               ca->undo_last_cong=0; // flag that ca->last_cong is  
not to be reset when enter TCP_CA_Open state
+       }

         return max(tp->snd_cwnd, (tp->snd_ssthresh << 7) / ca->beta);
  }
@@ -265,12 +268,15 @@
  static void htcp_state(struct sock *sk, u8 new_state)
  {
         switch (new_state) {
-       case TCP_CA_Open:
+       case TCP_CA_Open:
                 {
                         struct htcp *ca = inet_csk_ca(sk);
-                       ca->last_cong = jiffies;
+                       if (ca->undo_last_cong) {
+                               ca->last_cong=jiffies;
+                               ca->undo_last_cong=0;
+                       }
                 }
-               break;
+               break;
         case TCP_CA_CWR:
         case TCP_CA_Recovery:
         case TCP_CA_Loss:




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-11-12  9:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-09 19:09 [PATCH 2.6.27] tcp_htcp: last_cong bug fix Douglas Leith
2008-11-10  3:56 ` Lawrence Stewart
2008-11-10 10:07   ` Douglas Leith
2008-11-11  5:51     ` David Miller
2008-11-11  5:50 ` David Miller
2008-11-11 15:33   ` Douglas Leith
2008-11-11 22:16     ` David Miller
2008-11-12  8:36       ` Douglas Leith
2008-11-12  8:41         ` David Miller
2008-11-12  8:58     ` Douglas Leith
2008-11-12  9:44       ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).