summaryrefslogtreecommitdiffstats
path: root/src/net/netdevice.c
diff options
context:
space:
mode:
authorMichael Brown2007-01-18 21:39:17 +0100
committerMichael Brown2007-01-18 21:39:17 +0100
commitc014f607a8ca9bb394d8b8b7fe6638898e29fce7 (patch)
treef486c563fed14a2aa7f020965ef47ad41e98e53a /src/net/netdevice.c
parentMove include/malloc.h to include/gpxe/malloc.h, since everything in there (diff)
downloadipxe-c014f607a8ca9bb394d8b8b7fe6638898e29fce7.tar.gz
ipxe-c014f607a8ca9bb394d8b8b7fe6638898e29fce7.tar.xz
ipxe-c014f607a8ca9bb394d8b8b7fe6638898e29fce7.zip
Use total free memory as advertised window. This seems to be sufficient
to avoid drops even on slow NICs.
Diffstat (limited to 'src/net/netdevice.c')
-rw-r--r--src/net/netdevice.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/net/netdevice.c b/src/net/netdevice.c
index 2733d237..c5085918 100644
--- a/src/net/netdevice.c
+++ b/src/net/netdevice.c
@@ -398,8 +398,13 @@ static void net_step ( struct process *process ) {
/* Poll for new packets */
netdev_poll ( netdev, -1U );
- /* Process received packets */
- while ( ( pkb = netdev_rx_dequeue ( netdev ) ) ) {
+ /* 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 ( ( pkb = netdev_rx_dequeue ( netdev ) ) ) {
DBGC ( netdev, "NETDEV %p processing %p\n",
netdev, pkb );
netdev->ll_protocol->rx ( pkb, netdev );