Date: Thu, 25 Jan 2001 18:39:24 +0100 (CET) From: Paul Herman <pherman@frenchfries.net> To: Garrett Wollman <wollman@khavrinen.lcs.mit.edu> Cc: jayanth <jayanth@yahoo-inc.com>, <net@FreeBSD.ORG> Subject: Re: I have delayed ACK problems Message-ID: <Pine.BSF.4.32.0101251814480.11792-200000@husten.security.at12.de> In-Reply-To: <200101251617.LAA83006@khavrinen.lcs.mit.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Thu, 25 Jan 2001, Garrett Wollman wrote:
> <<On Thu, 25 Jan 2001 00:25:10 -0800, jayanth <jayanth@yahoo-inc.com> 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 don't think it is either -- trying it with the rmt(8) results in
each mss packet geting it's own ACK, which is the same behaviour as
turning of delayed acks all together.
This morning I came up with this patch, which *seems* to have solved
both problems: 1) the rmt(8) problem Bruce wrote about and 2) my
problem with the Solaris <-> FreeBSD problem I was experiencing.
Thing is, I'm no TCP expert, and I am way out of my league on this. In
fact, I'm certain it breaks something (for one the delayed ack counter no
longer runs up, hmmm, and a few connections will stall), but maybe it's a
start.
Whatever happened to TF_DELACK anyway?
-Paul.
[-- Attachment #2 --]
Index: tcp_input.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/tcp_input.c,v
retrieving revision 1.121
diff -u -r1.121 tcp_input.c
--- tcp_input.c 2000/12/15 21:45:49 1.121
+++ tcp_input.c 2001/01/25 17:36:21
@@ -178,9 +178,14 @@
if ((th)->th_seq == (tp)->rcv_nxt && \
LIST_EMPTY(&(tp)->t_segq) && \
(tp)->t_state == TCPS_ESTABLISHED) { \
- if (tcp_delack_enabled) \
- callout_reset(tp->tt_delack, tcp_delacktime, \
- tcp_timer_delack, tp); \
+ if (tcp_delack_enabled) { \
+ if (th->th_flags & TH_PUSH) { \
+ tp->t_flags |= TF_ACKNOW; \
+ callout_reset(tp->tt_delack, tcp_delacktime, tcp_timer_delack, tp); \
+ } \
+ else \
+ tp->t_flags |= TF_DELACK; \
+ } \
else \
tp->t_flags |= TF_ACKNOW; \
(tp)->rcv_nxt += *(tlenp); \
@@ -967,8 +972,13 @@
sbappend(&so->so_rcv, m);
sorwakeup(so);
if (tcp_delack_enabled) {
- callout_reset(tp->tt_delack, tcp_delacktime,
- tcp_timer_delack, tp);
+ if (th->th_flags & TH_PUSH) {
+ tp->t_flags |= TF_ACKNOW;
+ callout_reset(tp->tt_delack, tcp_delacktime,
+ tcp_timer_delack, tp);
+ }
+ else
+ tp->t_flags |= TF_DELACK;
} else {
tp->t_flags |= TF_ACKNOW;
tcp_output(tp);
Index: tcp_output.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/tcp_output.c,v
retrieving revision 1.48
diff -u -r1.48 tcp_output.c
--- tcp_output.c 2000/10/27 11:45:41 1.48
+++ tcp_output.c 2001/01/25 17:36:21
@@ -913,7 +913,7 @@
if (win > 0 && SEQ_GT(tp->rcv_nxt+win, tp->rcv_adv))
tp->rcv_adv = tp->rcv_nxt + win;
tp->last_ack_sent = tp->rcv_nxt;
- tp->t_flags &= ~TF_ACKNOW;
+ tp->t_flags &= ~(TF_ACKNOW|TF_DELACK);
if (tcp_delack_enabled)
callout_stop(tp->tt_delack);
if (sendalot && (!tcp_do_newreno || --maxburst))
Index: tcp_timer.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/tcp_timer.c,v
retrieving revision 1.39
diff -u -r1.39 tcp_timer.c
--- tcp_timer.c 2000/10/02 15:00:13 1.39
+++ tcp_timer.c 2001/01/25 17:36:21
@@ -173,11 +173,13 @@
splx(s);
return;
}
- callout_deactivate(tp->tt_delack);
-
- tp->t_flags |= TF_ACKNOW;
- tcpstat.tcps_delack++;
- (void) tcp_output(tp);
+ if (tp->t_flags & TF_DELACK) {
+ callout_deactivate(tp->tt_delack);
+ tp->t_flags &= ~TF_DELACK;
+ tp->t_flags |= TF_ACKNOW;
+ tcpstat.tcps_delack++;
+ (void) tcp_output(tp);
+ }
splx(s);
}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.32.0101251814480.11792-200000>
