From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: [PATCH 4/4] examples/vhost: fix wrong vlan_tag Date: Fri, 25 Mar 2016 14:01:34 +0800 Message-ID: <1458885694-31111-5-git-send-email-yuanhan.liu@linux.intel.com> References: <1458885694-31111-1-git-send-email-yuanhan.liu@linux.intel.com> Cc: huawei.xie@intel.com, Thomas Monjalon , Ksiadz MarcinX , Yuanhan Liu To: dev@dpdk.org Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 423A547D0 for ; Fri, 25 Mar 2016 06:59:05 +0100 (CET) In-Reply-To: <1458885694-31111-1-git-send-email-yuanhan.liu@linux.intel.com> 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" While the last arg of virtio_tx_route() asks a vlan tag, we currently feed it with device_fh, which is wrong. Fix it. Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application") Reported-by: Qian Xu Signed-off-by: Yuanhan Liu --- examples/vhost/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index ae1e110..00ae0de 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -1364,8 +1364,10 @@ switch_worker(__attribute__((unused)) void *arg) rte_pktmbuf_free(pkts_burst[--tx_count]); } } - for (i = 0; i < tx_count; ++i) - virtio_tx_route(vdev, pkts_burst[i], (uint16_t)dev->device_fh); + for (i = 0; i < tx_count; ++i) { + virtio_tx_route(vdev, pkts_burst[i], + vlan_tags[(uint16_t)dev->device_fh]); + } } /*move to the next device in the list*/ -- 1.9.0