[dpdk-dev] [PATCH] examples/vhost: fix out of sequence packets

Jianfeng Tan jianfeng.tan at intel.com
Tue Jan 19 20:18:11 CET 2016


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 at intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan at intel.com>
---
 examples/vhost/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 2dcdacb..aa9aa5a 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -1336,8 +1336,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*/
-- 
2.1.4



More information about the dev mailing list