From 1a95fe0be196ba80a29d5fc74481060a3c9b31b8 Mon Sep 17 00:00:00 2001 From: Yuanhan Liu Date: Fri, 25 Mar 2016 15:58:52 +0800 Subject: [PATCH] examples/vhost: fix VLAN tag 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 86e5c24c4b..28c17afd55 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -1396,8 +1396,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*/ -- 2.20.1