浏览代码

[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>
tags/v1.20.1
Michael Brown 13 年前
父节点
当前提交
b0e236a9ee
共有 1 个文件被更改,包括 2 次插入7 次删除
  1. 2
    7
      src/net/netdevice.c

+ 2
- 7
src/net/netdevice.c 查看文件

750
 		if ( netdev_rx_frozen ( netdev ) )
750
 		if ( netdev_rx_frozen ( netdev ) )
751
 			continue;
751
 			continue;
752
 
752
 
753
-		/* Process at most one received packet.  Give priority
754
-		 * to getting packets out of the NIC over processing
755
-		 * the received packets, because we advertise a window
756
-		 * that assumes that we can receive packets from the
757
-		 * NIC faster than they arrive.
758
-		 */
759
-		if ( ( iobuf = netdev_rx_dequeue ( netdev ) ) ) {
753
+		/* Process all received packets */
754
+		while ( ( iobuf = netdev_rx_dequeue ( netdev ) ) ) {
760
 
755
 
761
 			DBGC2 ( netdev, "NETDEV %s processing %p (%p+%zx)\n",
756
 			DBGC2 ( netdev, "NETDEV %s processing %p (%p+%zx)\n",
762
 				netdev->name, iobuf, iobuf->data,
757
 				netdev->name, iobuf, iobuf->data,

正在加载...
取消
保存