2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-23 01:51:58 +00:00

[lotest] Use network device receive queue freezing

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2010-11-20 05:03:06 +00:00
parent 69d1e6cf57
commit 3633bb246c

View File

@ -119,6 +119,11 @@ int loopback_test ( struct net_device *sender, struct net_device *receiver,
ifstat ( sender );
ifstat ( receiver );
/* Freeze receive queue processing on the receiver, so that we
* can extract all received packets.
*/
netdev_rx_freeze ( receiver );
/* Perform loopback test */
for ( successes = 0 ; ; successes++ ) {
@ -155,8 +160,7 @@ int loopback_test ( struct net_device *sender, struct net_device *receiver,
goto done;
}
/* Poll network devices */
netdev_poll ( sender );
netdev_poll ( receiver );
net_poll();
} while ( ( iobuf = netdev_rx_dequeue ( receiver ) ) == NULL );
/* Check received packet */
@ -203,6 +207,7 @@ int loopback_test ( struct net_device *sender, struct net_device *receiver,
done:
printf ( "\n");
free_iob ( iobuf );
netdev_rx_unfreeze ( receiver );
/* Dump final statistics */
ifstat ( sender );