From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id DAAD92952 for ; Thu, 29 Sep 2016 03:54:37 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP; 28 Sep 2016 18:54:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,412,1470726000"; d="scan'208";a="1063728937" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by fmsmga002.fm.intel.com with ESMTP; 28 Sep 2016 18:54:36 -0700 Date: Thu, 29 Sep 2016 09:55:12 +0800 From: Yuanhan Liu To: Zhiyong Yang Cc: dev@dpdk.org, ciara.loftus@intel.com Message-ID: <20160929015512.GI1597@yliu-dev.sh.intel.com> References: <1475051598-74475-2-git-send-email-zhiyong.yang@intel.com> <1475069208-137698-1-git-send-email-zhiyong.yang@intel.com> <1475069208-137698-2-git-send-email-zhiyong.yang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1475069208-137698-2-git-send-email-zhiyong.yang@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v7 1/2] net/vhost: add a new defined stats struct 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: Thu, 29 Sep 2016 01:54:38 -0000 On Wed, Sep 28, 2016 at 09:26:47PM +0800, Zhiyong Yang wrote: > The patch moves all stats counters to a new defined struct vhost_stats > as follows, in order to manage all stats counters in a unified way and > simplify the subsequent function implementation(vhost_dev_xstats_reset). > > Signed-off-by: Zhiyong Yang > --- > > Changes in v4: > A queue can be only used as TX or RX, So, we can use pkts instead of > rx_pkts and tx_pkts, the same to rx_bytes and tx_bytes. > before modification: > struct vhost_stats { > uint64_t rx_pkts; > uint64_t tx_pkts; > uint64_t missed_pkts; > uint64_t rx_bytes; > uint64_t tx_bytes; > }; > New struct vhost_stats definition as follows: > struct vhost_stats { > uint64_t pkts; > uint64_t bytes; > uint64_t missed_pkts; > }; > > drivers/net/vhost/rte_eth_vhost.c | 36 +++++++++++++++++++++--------------- > 1 file changed, 21 insertions(+), 15 deletions(-) > > diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c > index 7539cd4..d99d4ee 100644 > --- a/drivers/net/vhost/rte_eth_vhost.c > +++ b/drivers/net/vhost/rte_eth_vhost.c > @@ -72,6 +72,12 @@ static struct ether_addr base_eth_addr = { > } > }; > > +struct vhost_stats { > + uint64_t pkts; > + uint64_t bytes; > + uint64_t missed_pkts; > +}; > + > struct vhost_queue { > int vid; > rte_atomic32_t allow_queuing; > @@ -145,11 +151,11 @@ eth_vhost_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) > nb_rx = rte_vhost_dequeue_burst(r->vid, > r->virtqueue_id, r->mb_pool, bufs, nb_bufs); > > - r->rx_pkts += nb_rx; > + r->stats.pkts += nb_rx; My robot caught a build error: /yeti/vm/ubuntu-initrd-16.04-x86_64-build/dpdk/drivers/net/vhost/rte_eth_vhost.c:154:5: error: no member named 'stats' in 'struct vhost_queue' r->stats.pkts += nb_rx; ~ ^ --yliu