From patchwork Wed Dec 2 23:20:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jianfeng Tan X-Patchwork-Id: 9285 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 944605A6C; Thu, 3 Dec 2015 07:20:44 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 01BE858DB for ; Thu, 3 Dec 2015 07:20:42 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 02 Dec 2015 22:20:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,376,1444719600"; d="scan'208";a="699283062" Received: from tan-s2600cw.sh.intel.com ([10.239.128.225]) by orsmga003.jf.intel.com with ESMTP; 02 Dec 2015 22:20:40 -0800 From: Jianfeng Tan To: dev@dpdk.org Date: Thu, 3 Dec 2015 07:20:26 +0800 Message-Id: <1449098426-128162-1-git-send-email-jianfeng.tan@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1449009174-93334-1-git-send-email-jianfeng.tan@intel.com> References: <1449009174-93334-1-git-send-email-jianfeng.tan@intel.com> Subject: [dpdk-dev] [PATCH v3] examples/vhost: fix statistics error 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" 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 9bfda6d..dc3a012 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; } }