svn commit: r242602 - user/andre/tcp_workqueue/sys/netinet

Andre Oppermann andre at FreeBSD.org
Mon Nov 5 09:23:22 UTC 2012


Author: andre
Date: Mon Nov  5 09:23:21 2012
New Revision: 242602
URL: http://svnweb.freebsd.org/changeset/base/242602

Log:
  Partial fix for window update problems.

Modified:
  user/andre/tcp_workqueue/sys/netinet/tcp_output.c

Modified: user/andre/tcp_workqueue/sys/netinet/tcp_output.c
==============================================================================
--- user/andre/tcp_workqueue/sys/netinet/tcp_output.c	Mon Nov  5 09:13:06 2012	(r242601)
+++ user/andre/tcp_workqueue/sys/netinet/tcp_output.c	Mon Nov  5 09:23:21 2012	(r242602)
@@ -228,7 +228,7 @@ again:
 	tso = 0;
 	mtu = 0;
 	off = tp->snd_nxt - tp->snd_una;
-	sendwin = min(tp->snd_wnd, tp->snd_cwnd);
+	sendwin = ulmax(ulmin(tp->snd_wnd - off, tp->snd_cwnd), 0);
 
 	flags = tcp_outflags[tp->t_state];
 	/*
@@ -249,7 +249,7 @@ again:
 	    (p = tcp_sack_output(tp, &sack_bytes_rxmt))) {
 		long cwin;
 		
-		cwin = min(tp->snd_wnd, tp->snd_cwnd) - sack_bytes_rxmt;
+		cwin = ulmin(tp->snd_wnd - off, tp->snd_cwnd) - sack_bytes_rxmt;
 		if (cwin < 0)
 			cwin = 0;
 		/* Do not retransmit SACK segments beyond snd_recover */
@@ -355,7 +355,7 @@ after_sack_rexmit:
 			 * sending new data, having retransmitted all the
 			 * data possible in the scoreboard.
 			 */
-			len = ((long)ulmin(so->so_snd.sb_cc, tp->snd_wnd) 
+			len = ((long)ulmin(so->so_snd.sb_cc, tp->snd_wnd - off)
 			       - off);
 			/*
 			 * Don't remove this (len > 0) check !


More information about the svn-src-user mailing list