summaryrefslogtreecommitdiffstats
path: root/src/net/netdevice.c
diff options
context:
space:
mode:
authorMichael Brown2012-07-01 23:47:06 +0200
committerMichael Brown2012-07-04 14:41:49 +0200
commitb0e236a9ee512f61d85bc1dfea57fafa04b3f214 (patch)
treed14a42c0af1eba28bb8ebd4f77d88de81f33427d /src/net/netdevice.c
parent[cmdline] Do not ignore empty initial arguments in concat_args() (diff)
downloadipxe-b0e236a9ee512f61d85bc1dfea57fafa04b3f214.tar.gz
ipxe-b0e236a9ee512f61d85bc1dfea57fafa04b3f214.tar.xz
ipxe-b0e236a9ee512f61d85bc1dfea57fafa04b3f214.zip
[netdevice] Process all received packets in net_poll()
The current logic is to process at most one received packet per call to net_poll(), on the basis that refilling the hardware descriptor ring should be delayed as little as possible. However, this limits the rate at which packets can be processed and ultimately ends up adding latency which, in turn, limits the achievable throughput. With temporary modifications in place to essentially remove all resource constraints (heap size increased to 16MB, RX descriptor ring increased to 64 descriptors) and a TCP window size of 1MB, the throughput on a gigabit (i.e. 119MBps) network can be observed to fall off exponentially from around 115MBps to around 75MBps. Changing net_poll() to process all received packets results in a steady 119MBps throughput. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/netdevice.c')
-rw-r--r--src/net/netdevice.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/net/netdevice.c b/src/net/netdevice.c
index b9b1337a..6afe2d5f 100644
--- a/src/net/netdevice.c
+++ b/src/net/netdevice.c
@@ -750,13 +750,8 @@ void net_poll ( void ) {
if ( netdev_rx_frozen ( netdev ) )
continue;
- /* Process at most one received packet. Give priority
- * to getting packets out of the NIC over processing
- * the received packets, because we advertise a window
- * that assumes that we can receive packets from the
- * NIC faster than they arrive.
- */
- if ( ( iobuf = netdev_rx_dequeue ( netdev ) ) ) {
+ /* Process all received packets */
+ while ( ( iobuf = netdev_rx_dequeue ( netdev ) ) ) {
DBGC2 ( netdev, "NETDEV %s processing %p (%p+%zx)\n",
netdev->name, iobuf, iobuf->data,