From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id B59F93796 for ; Mon, 23 Mar 2015 09:38:33 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 23 Mar 2015 01:38:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,450,1422950400"; d="scan'208,217";a="544825377" Received: from couyang-mobl2.ccr.corp.intel.com (HELO [10.239.201.46]) ([10.239.201.46]) by orsmga003.jf.intel.com with ESMTP; 23 Mar 2015 01:38:31 -0700 Message-ID: <550FD107.8060109@intel.com> Date: Mon, 23 Mar 2015 16:38:31 +0800 From: "Ouyang, Changchun" User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: David Marchand References: <1427093798-23078-1-git-send-email-changchun.ouyang@intel.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] virtio: Fix stats issue 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: , X-List-Received-Date: Mon, 23 Mar 2015 08:38:34 -0000 On 3/23/2015 3:20 PM, David Marchand wrote: > Hello, > > Hello, > > On Mon, Mar 23, 2015 at 7:56 AM, Ouyang Changchun > > wrote: > > It need clear/reset the stats information before count in all > queues data. > > Signed-off-by: Changchun Ouyang > > --- > lib/librte_pmd_virtio/virtio_ethdev.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/lib/librte_pmd_virtio/virtio_ethdev.c > b/lib/librte_pmd_virtio/virtio_ethdev.c > index 603be2d..e4cb55e 100644 > --- a/lib/librte_pmd_virtio/virtio_ethdev.c > +++ b/lib/librte_pmd_virtio/virtio_ethdev.c > @@ -572,6 +572,10 @@ virtio_dev_stats_get(struct rte_eth_dev *dev, > struct rte_eth_stats *stats) > { > unsigned i; > > + stats->opackets = 0; > + stats->obytes = 0; > + stats->oerrors = 0; > > > stats are supposed to be zero'd in generic rte_ethdev.c before this > pmd function is called, so this patch seems useless to me. > Can you give some context ? > > Same comment for the i* part. > 2 reasons: 1. this change could keep the stats_get has consistent behavior with the one in other drivers; 2. we don't rely on the assumption of caller always zero'd the stats, and still can return correct value; thanks Changchun