From owner-freebsd-net Thu Jan 25 9:14:50 2001 Delivered-To: freebsd-net@freebsd.org Received: from prism.flugsvamp.com (cb58709-a.mdsn1.wi.home.com [24.17.241.9]) by hub.freebsd.org (Postfix) with ESMTP id C8A4337B402; Thu, 25 Jan 2001 09:14:30 -0800 (PST) Received: (from jlemon@localhost) by prism.flugsvamp.com (8.11.0/8.11.0) id f0PHE3L73868; Thu, 25 Jan 2001 11:14:03 -0600 (CST) (envelope-from jlemon) Date: Thu, 25 Jan 2001 11:14:03 -0600 (CST) From: Jonathan Lemon Message-Id: <200101251714.f0PHE3L73868@prism.flugsvamp.com> To: wollman@khavrinen.lcs.mit.edu, net@freebsd.org, jayanth@freebsd.org Subject: Re: I have delayed ACK problems X-Newsgroups: local.mail.freebsd-net In-Reply-To: References: Organization: Cc: Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org In article you write: >< said: > >> could you test this patch and compare the results. >> By generating an ACK for every segment with the TH_PSH flag set >> I found a significant increase in throughput. > >I don't think this is right. > >I think what we want to do is: > > if (callout_pending(tp->tt_delack)) { > callout_stop(tp->tt_delack); > tp->t_flags |= TF_ACKNOW; > } else > callout_reset(...) I'm not sure this is required. Expanding the context of the area in question: /* * Add data to socket buffer. */ m_adj(m, drop_hdrlen); /* delayed header drop */ sbappend(&so->so_rcv, m); sorwakeup(so); if (tcp_delack_enabled) { callout_reset(tp->tt_delack, tcp_delacktime, tcp_timer_delack, tp); } else { tp->t_flags |= TF_ACKNOW; tcp_output(tp); } return; From the bottom portion of tcp_output(): tp->last_ack_sent = tp->rcv_nxt; tp->t_flags &= ~TF_ACKNOW; if (tcp_delack_enabled) callout_stop(tp->tt_delack); So simply setting TF_ACKNOW and calling tcp_output should be sufficient; if there is a pending delack timer it will get turned off when the ACK is actually sent. I think that jayanth's patch is correct, although I slightly dislike tying it to the PSH flag - not all implementations actually set this. However, it is better than the lower bound of acking every incoming data packet. -- Jonathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message