Browse Source

[lotest] Use network device receive queue freezing

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 14 years ago
parent
commit
3633bb246c
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      src/usr/lotest.c

+ 7
- 2
src/usr/lotest.c View File

119
 	ifstat ( sender );
119
 	ifstat ( sender );
120
 	ifstat ( receiver );
120
 	ifstat ( receiver );
121
 
121
 
122
+	/* Freeze receive queue processing on the receiver, so that we
123
+	 * can extract all received packets.
124
+	 */
125
+	netdev_rx_freeze ( receiver );
126
+
122
 	/* Perform loopback test */
127
 	/* Perform loopback test */
123
 	for ( successes = 0 ; ; successes++ ) {
128
 	for ( successes = 0 ; ; successes++ ) {
124
 
129
 
155
 				goto done;
160
 				goto done;
156
 			}
161
 			}
157
 			/* Poll network devices */
162
 			/* Poll network devices */
158
-			netdev_poll ( sender );
159
-			netdev_poll ( receiver );
163
+			net_poll();
160
 		} while ( ( iobuf = netdev_rx_dequeue ( receiver ) ) == NULL );
164
 		} while ( ( iobuf = netdev_rx_dequeue ( receiver ) ) == NULL );
161
 
165
 
162
 		/* Check received packet */
166
 		/* Check received packet */
203
  done:
207
  done:
204
 	printf ( "\n");
208
 	printf ( "\n");
205
 	free_iob ( iobuf );
209
 	free_iob ( iobuf );
210
+	netdev_rx_unfreeze ( receiver );
206
 
211
 
207
 	/* Dump final statistics */
212
 	/* Dump final statistics */
208
 	ifstat ( sender );
213
 	ifstat ( sender );

Loading…
Cancel
Save