]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[tcp] Defer sending ACKs until all received packets have been processed
authorMichael Brown <mcb30@ipxe.org>
Wed, 7 May 2014 01:31:48 +0000 (02:31 +0100)
committerMichael Brown <mcb30@ipxe.org>
Mon, 12 May 2014 16:19:26 +0000 (17:19 +0100)
commitd28bb51f445250d7bd7ccfb5b53f2ffa985e1fba
tree67370935765c325819db66f382a7ce8492d5fbd6
parent7aa69c4d0d997d995167683d18cb1e85d69e6018
[tcp] Defer sending ACKs until all received packets have been processed

When running inside a virtual machine (or when using the UNDI driver),
transmitting packets can be expensive.  When we receive several
packets in one poll (e.g. because a slow BIOS timer interrupt routine
has caused us to fall behind in processing), we can safely send just a
single ACK to cover all of the received packets.  This reduces the
time spent transmitting and allows us to clear the backlog much
faster.

Various RFCs (starting with RFC1122) state that there should be an ACK
for at least every second segment.  We choose not to enforce this
rule.  Under normal operation each poll should find at most one
received packet, and we will then not delay any ACKs.  We delay
(i.e. omit) ACKs only when under sufficiently heavy load that we are
finding multiple packets per poll; under these conditions it is
important to clear the backlog quickly since any delay may lead to
dropped packets.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/tcp.c