From 4c7bcd79be8702dc71844a3aaf0666174e7d3c14 Mon Sep 17 00:00:00 2001 From: Jianfeng Tan Date: Thu, 3 Dec 2015 07:20:26 +0800 Subject: [PATCH] examples/vhost: fix statistics This issue was discovered under the case of software vm2vm fowarding. When pkts are received from virtio device 0 and tx_route to virtio device 1, tx of device 0 is not updated. Signed-off-by: Jianfeng Tan Tested-by: Qian Xu 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 9bfda6d444..dc3a0125ad 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -1050,8 +1050,8 @@ virtio_tx_local(struct vhost_dev *vdev, struct rte_mbuf *m) rte_atomic64_add( &dev_statistics[tdev->device_fh].rx_atomic, ret); - dev_statistics[tdev->device_fh].tx_total++; - dev_statistics[tdev->device_fh].tx += ret; + dev_statistics[dev->device_fh].tx_total++; + dev_statistics[dev->device_fh].tx += ret; } } -- 2.20.1