examples/vhost: fix out of sequence packets

Issue description: when packets go through vhost example to virtio
device and come back to another virtio device or physical NIC, the
sequence of packets will be changed.

Reported-by: Thomas Long <thomas.long@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
This commit is contained in:
Jianfeng Tan 2016-01-20 03:18:11 +08:00 committed by Thomas Monjalon
parent 5499c1fc9b
commit e1c648055f

View File

@ -1422,8 +1422,8 @@ switch_worker(__attribute__((unused)) void *arg)
rte_pktmbuf_free(pkts_burst[--tx_count]);
}
}
while (tx_count)
virtio_tx_route(vdev, pkts_burst[--tx_count], (uint16_t)dev->device_fh);
for (i = 0; i < tx_count; ++i)
virtio_tx_route(vdev, pkts_burst[i], (uint16_t)dev->device_fh);
}
/*move to the next device in the list*/