Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jul 2013 14:24:38 +0000 (UTC)
From:      Andre Oppermann <andre@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r252786 - stable/9/sys/netinet
Message-ID:  <201307051424.r65EOco3056662@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andre
Date: Fri Jul  5 14:24:37 2013
New Revision: 252786
URL: http://svnweb.freebsd.org/changeset/base/252786

Log:
  MFC r249809:
  
   When doing RFC3042 limited transmit on the first on second
   duplicate ACK make sure we actually have new data to send.
   This prevents us from sending unneccessary pure ACKs.
  
   Reported by:	Matt Miller <matt@matthewjmiller.net>

Modified:
  stable/9/sys/netinet/tcp_input.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netinet/tcp_input.c
==============================================================================
--- stable/9/sys/netinet/tcp_input.c	Fri Jul  5 14:18:09 2013	(r252785)
+++ stable/9/sys/netinet/tcp_input.c	Fri Jul  5 14:24:37 2013	(r252786)
@@ -2532,6 +2532,7 @@ tcp_do_segment(struct mbuf *m, struct tc
 					u_long oldcwnd = tp->snd_cwnd;
 					tcp_seq oldsndmax = tp->snd_max;
 					u_int sent;
+					int avail;
 
 					KASSERT(tp->t_dupacks == 1 ||
 					    tp->t_dupacks == 2,
@@ -2553,7 +2554,17 @@ tcp_do_segment(struct mbuf *m, struct tc
 						 */
 						break;
 					}
-					(void) tcp_output(tp);
+					/*
+					 * Only call tcp_output when there
+					 * is new data available to be sent.
+					 * Otherwise we would send pure ACKs.
+					 */
+					SOCKBUF_LOCK(&so->so_snd);
+					avail = so->so_snd.sb_cc -
+					    (tp->snd_nxt - tp->snd_una);
+					SOCKBUF_UNLOCK(&so->so_snd);
+					if (avail > 0)
+						(void) tcp_output(tp);
 					sent = tp->snd_max - oldsndmax;
 					if (sent > tp->t_maxseg) {
 						KASSERT((tp->t_dupacks == 2 &&



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307051424.r65EOco3056662>