cvs commit: src/sys/netinet ip_demux.c tcp_input.c tcp_subr.c tcp_var.h
Matthew Dillon
dillon at crater.dragonflybsd.org
Mon Aug 2 17:05:00 PDT 2004
dillon 2004/08/02 17:04:13 PDT
DragonFly src repository
Modified files:
sys/netinet ip_demux.c tcp_input.c tcp_subr.c
tcp_var.h
Log:
tcp_input()'s DELAY_ACK() code checks to see if the delayed ack timer is
running and if it is not it starts it and returns rather then issue an
ack. If the timer is already running tcp_input() will generate an immediate
ack, resulting in one ack every other packet. This every-other-packet ack
is usually required to ensure that the window does not close too much and
stall the sender, but it really only exists because the tcp stack does not
look ahead to see if there are other incoming packets that need to be
processed that might themselves require additional acks. For optimal
operation we really want to process all the pending TCP packets for
the connection before sending any 'normal' acks.
Many ethernet interfaces, including and most especially GigE interfaces,
rate-limit their interrupts. This results in several packets being moved
from the RX ring to the TCP/IP stack all at once, in a batch.
GIVE THE TCP stack its own netisr dispatcher loop rather then using the
generic netisr dispatcher loop. The TCP dispatcher loop will call an
additional routine, tcp_willblock(), after all messages queued to the TCP
protocol stack have been exhausted.
When tcp_input() needs to send an ack in the normal header-prediction case
it now places the TCPCB on a queue rather then send an immediate ack.
tcp_willblock() processes this queue and calls tcp_output() to send the
actual ack.
The result is that on a GigE interface which typically queues 8+ packets
per interrupt, a TCP stream will only be acked once per ~8 packets rather
then 4 times (every other packet) per ~8 packets. This *GREATLY* reduces TCP
protocol overhead and network ack traffic on both ends of the connection.
NOTE: a later commit will deal with pure window space updates which generate
an additional ACK per ~8 packets when the user program drains the buffer.
Reviewed-by: Jeffrey Hsu <hsu at xxxxxxxxxxxxxxxxxxxxxxx>
Revision Changes Path
1.26 +1 -1 src/sys/netinet/ip_demux.c
1.33 +16 -3 src/sys/netinet/tcp_input.c
1.37 +40 -0 src/sys/netinet/tcp_subr.c
1.25 +8 -1 src/sys/netinet/tcp_var.h
http://www.dragonflybsd.org/cvsweb/src/sys/netinet/ip_demux.c.diff?r1=1.25&r2=1.26&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/netinet/tcp_input.c.diff?r1=1.32&r2=1.33&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/netinet/tcp_subr.c.diff?r1=1.36&r2=1.37&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/netinet/tcp_var.h.diff?r1=1.24&r2=1.25&f=u
More information about the Commits
mailing list