|
@@ -294,7 +294,13 @@ int net_rx_process ( struct pk_buff *pkb ) {
|
294
|
294
|
* @v process Network stack process
|
295
|
295
|
*
|
296
|
296
|
* This polls all interfaces for any received packets, and processes
|
297
|
|
- * any packets that are received during this poll.
|
|
297
|
+ * at most one packet from the RX queue.
|
|
298
|
+ *
|
|
299
|
+ * We avoid processing all received packets, because processing the
|
|
300
|
+ * received packet can trigger transmission of a new packet (e.g. an
|
|
301
|
+ * ARP response). Since TX completions will be processed as part of
|
|
302
|
+ * the poll operation, it is easy to overflow small TX queues if
|
|
303
|
+ * multiple packets are processed per poll.
|
298
|
304
|
*/
|
299
|
305
|
static void net_step ( struct process *process ) {
|
300
|
306
|
struct pk_buff *pkb;
|
|
@@ -302,8 +308,8 @@ static void net_step ( struct process *process ) {
|
302
|
308
|
/* Poll for new packets */
|
303
|
309
|
net_poll();
|
304
|
310
|
|
305
|
|
- /* Handle any received packets */
|
306
|
|
- while ( ( pkb = net_rx_dequeue () ) ) {
|
|
311
|
+ /* Handle at most one received packet */
|
|
312
|
+ if ( ( pkb = net_rx_dequeue () ) ) {
|
307
|
313
|
net_rx_process ( pkb );
|
308
|
314
|
DBG ( "Processed received packet\n" );
|
309
|
315
|
}
|