|
@@ -187,6 +187,8 @@ static int vring_get_buf(int queue_index, unsigned int *len)
|
187
|
187
|
u32 id;
|
188
|
188
|
int ret;
|
189
|
189
|
|
|
190
|
+ BUG_ON(!vring_more_used(queue_index));
|
|
191
|
+
|
190
|
192
|
elem = &vr->used->ring[last_used_idx[queue_index] % vr->num];
|
191
|
193
|
wmb();
|
192
|
194
|
id = elem->id;
|
|
@@ -365,6 +367,8 @@ static void virtnet_transmit(struct nic *nic, const char *destaddr,
|
365
|
367
|
|
366
|
368
|
vring_add_buf(TX_INDEX, 0, 0);
|
367
|
369
|
|
|
370
|
+ vring_kick(nic, TX_INDEX, 1);
|
|
371
|
+
|
368
|
372
|
/*
|
369
|
373
|
* http://www.etherboot.org/wiki/dev/devmanual
|
370
|
374
|
*
|
|
@@ -372,13 +376,11 @@ static void virtnet_transmit(struct nic *nic, const char *destaddr,
|
372
|
376
|
* before returning from this routine"
|
373
|
377
|
*/
|
374
|
378
|
|
375
|
|
- while (vring_more_used(TX_INDEX)) {
|
|
379
|
+ while (!vring_more_used(TX_INDEX)) {
|
376
|
380
|
mb();
|
377
|
381
|
udelay(10);
|
378
|
382
|
}
|
379
|
383
|
|
380
|
|
- vring_kick(nic, TX_INDEX, 1);
|
381
|
|
-
|
382
|
384
|
/* free desc */
|
383
|
385
|
|
384
|
386
|
(void)vring_get_buf(TX_INDEX, NULL);
|