Avoid causing TX overflow on small TX queues.
This commit is contained in:
parent
70ef6dbb7c
commit
cd3ecac809
|
@ -294,7 +294,13 @@ int net_rx_process ( struct pk_buff *pkb ) {
|
||||||
* @v process Network stack process
|
* @v process Network stack process
|
||||||
*
|
*
|
||||||
* This polls all interfaces for any received packets, and processes
|
* 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 ) {
|
static void net_step ( struct process *process ) {
|
||||||
struct pk_buff *pkb;
|
struct pk_buff *pkb;
|
||||||
|
@ -302,8 +308,8 @@ static void net_step ( struct process *process ) {
|
||||||
/* Poll for new packets */
|
/* Poll for new packets */
|
||||||
net_poll();
|
net_poll();
|
||||||
|
|
||||||
/* Handle any received packets */
|
/* Handle at most one received packet */
|
||||||
while ( ( pkb = net_rx_dequeue () ) ) {
|
if ( ( pkb = net_rx_dequeue () ) ) {
|
||||||
net_rx_process ( pkb );
|
net_rx_process ( pkb );
|
||||||
DBG ( "Processed received packet\n" );
|
DBG ( "Processed received packet\n" );
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue