diff --git a/src/usr/lotest.c b/src/usr/lotest.c index 407f6844..6c87923c 100644 --- a/src/usr/lotest.c +++ b/src/usr/lotest.c @@ -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 );