From: Jianfeng Tan Date: Tue, 19 Jan 2016 19:18:11 +0000 (+0800) Subject: examples/vhost: fix out of sequence packets X-Git-Tag: spdx-start~7584 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e1c648055f48003a2b8cbc80979a8f48a3e5f114;p=dpdk.git 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 Signed-off-by: Jianfeng Tan Acked-by: Yuanhan Liu --- diff --git a/examples/vhost/main.c b/examples/vhost/main.c index a97300b954..a45cddb800 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -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*/