diff mbox

[2.6.27] tcp_htcp: last_cong bug fix

Message ID B4ABF490-649C-4981-A953-B5FA55022EBD@nuim.ie
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Douglas Leith Nov. 11, 2008, 3:33 p.m. UTC
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.

Signed-off-by:  Doug Leith <doug.leith@nuim.ie>

---

Revised patch with requested style changes.




--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller Nov. 11, 2008, 10:16 p.m. UTC | #1
From: Douglas Leith <Doug.Leith@nuim.ie>
Date: Tue, 11 Nov 2008 15:33:33 +0000

> Revised patch with requested style changes.

Your email client corrupted the patch, turning tab characters
into spaces.

Please turn off content formatting in your email client,
or alternatively use an attachment for the patch itself.

There is some help in linux/Documentation/email-clients.txt

Please fix this up and resubmit, thank you very much.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Douglas Leith Nov. 12, 2008, 8:36 a.m. UTC | #2
Patch attached.

On 11 Nov 2008, at 22:16, David Miller wrote:

> From: Douglas Leith <Doug.Leith@nuim.ie>
> Date: Tue, 11 Nov 2008 15:33:33 +0000
>
>> Revised patch with requested style changes.
>
> Your email client corrupted the patch, turning tab characters
> into spaces.
>
> Please turn off content formatting in your email client,
> or alternatively use an attachment for the patch itself.
>
> There is some help in linux/Documentation/email-clients.txt
>
> Please fix this up and resubmit, thank you very much.
David Miller Nov. 12, 2008, 8:41 a.m. UTC | #3
From: Douglas Leith <Doug.Leith@nuim.ie>
Date: Wed, 12 Nov 2008 08:36:30 +0000

> Patch attached.

I wanted you to make a full resubmission with the patch fixed up.

Otherwise I don't have your commit message, and it isn't all collected
properly when your patch is logged to:

	http://patchwork.ozlabs.org/project/netdev/list

When you are requested to fixup a patch or make some modification,
always, and I do mean always, make a fresh new submission (changelog
and all) unless you are told otherwise.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- net/ipv4/tcp_htcp.c 2008-11-05 15:50:18.000000000 +0000
+++ net/ipv4/tcp_htcp.c.new     2008-11-11 15:20:31.000000000 +0000
@@ -71,5 +71,8 @@  static u32 htcp_cwnd_undo(struct sock *s

-       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;
+       }

@@ -267,8 +270,11 @@  static void htcp_state(struct sock *sk,
         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: