diff options
author | Michael Brown | 2006-05-27 15:55:36 +0200 |
---|---|---|
committer | Michael Brown | 2006-05-27 15:55:36 +0200 |
commit | cd3ecac809cf78f8a346f1b935e6a52ca77ca37d (patch) | |
tree | 1dd8131656df77c7bcc5d6caf6b58fbb825f4021 /src/net/netdevice.c | |
parent | Rewrote to use the new net driver API, the updated PCI API, and the (diff) | |
download | ipxe-cd3ecac809cf78f8a346f1b935e6a52ca77ca37d.tar.gz ipxe-cd3ecac809cf78f8a346f1b935e6a52ca77ca37d.tar.xz ipxe-cd3ecac809cf78f8a346f1b935e6a52ca77ca37d.zip |
Avoid causing TX overflow on small TX queues.
Diffstat (limited to 'src/net/netdevice.c')
-rw-r--r-- | src/net/netdevice.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/net/netdevice.c b/src/net/netdevice.c index 47b37cf7..3d4640a8 100644 --- a/src/net/netdevice.c +++ b/src/net/netdevice.c @@ -294,7 +294,13 @@ int net_rx_process ( struct pk_buff *pkb ) { * @v process Network stack process * * This polls all interfaces for any received packets, and processes - * any packets that are received during this poll. + * at most one packet from the RX queue. + * + * We avoid processing all received packets, because processing the + * received packet can trigger transmission of a new packet (e.g. an + * ARP response). Since TX completions will be processed as part of + * the poll operation, it is easy to overflow small TX queues if + * multiple packets are processed per poll. */ static void net_step ( struct process *process ) { struct pk_buff *pkb; @@ -302,8 +308,8 @@ static void net_step ( struct process *process ) { /* Poll for new packets */ net_poll(); - /* Handle any received packets */ - while ( ( pkb = net_rx_dequeue () ) ) { + /* Handle at most one received packet */ + if ( ( pkb = net_rx_dequeue () ) ) { net_rx_process ( pkb ); DBG ( "Processed received packet\n" ); } |