From patchwork Tue Jan 19 19:18:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jianfeng Tan X-Patchwork-Id: 9989 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id E889B5A62; Wed, 20 Jan 2016 03:18:34 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id C13D6595E for ; Wed, 20 Jan 2016 03:18:32 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 19 Jan 2016 18:18:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,319,1449561600"; d="scan'208";a="896979472" Received: from dpdk06.sh.intel.com ([10.239.128.225]) by fmsmga002.fm.intel.com with ESMTP; 19 Jan 2016 18:18:30 -0800 From: Jianfeng Tan To: dev@dpdk.org Date: Wed, 20 Jan 2016 03:18:11 +0800 Message-Id: <1453231091-117603-1-git-send-email-jianfeng.tan@intel.com> X-Mailer: git-send-email 2.1.4 Subject: [dpdk-dev] [PATCH] examples/vhost: fix out of sequence packets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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*/