Patchwork [5/7] tcp_cubic: enable high resolution ack time if needed

login
register
mail settings
Submitter stephen hemminger
Date March 14, 2011, 5:52 p.m.
Message ID <20110314175439.657008198@vyatta.com>
Download mbox | patch
Permalink /patch/86789/
State Accepted
Delegated to: David Miller
Headers show

Comments

stephen hemminger - March 14, 2011, 5:52 p.m.
This is a refined version of an earlier patch by Lucas Nussbaum.
Cubic needs RTT values in milliseconds. If HZ < 1000 then
the values will be too coarse.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Reported-by: Lucas Nussbaum <lucas.nussbaum@loria.fr>



--
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

Patch

--- a/net/ipv4/tcp_cubic.c	2011-03-14 08:22:42.486690594 -0700
+++ b/net/ipv4/tcp_cubic.c	2011-03-14 08:27:24.435852847 -0700
@@ -459,6 +459,10 @@  static int __init cubictcp_register(void
 	/* divide by bic_scale and by constant Srtt (100ms) */
 	do_div(cube_factor, bic_scale * 10);
 
+	/* hystart needs ms clock resolution */
+	if (hystart && HZ < 1000)
+		cubictcp.flags |= TCP_CONG_RTT_STAMP;
+
 	return tcp_register_congestion_control(&cubictcp);
 }