From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id EA0487F0C for ; Fri, 21 Nov 2014 13:18:21 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 21 Nov 2014 04:28:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,429,1413270000"; d="scan'208";a="635864697" Received: from pgsmsx107.gar.corp.intel.com ([10.221.44.105]) by fmsmga002.fm.intel.com with ESMTP; 21 Nov 2014 04:28:39 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by PGSMSX107.gar.corp.intel.com (10.221.44.105) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 21 Nov 2014 20:28:38 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by shsmsx102.ccr.corp.intel.com ([169.254.2.216]) with mapi id 14.03.0195.001; Fri, 21 Nov 2014 20:28:35 +0800 From: "Liu, Jijiang" To: "Zang, Zhida" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3] i40e: fixed tx packets stats bug Thread-Index: AQHQBWJdaIvSc8Mxe0+jhbjy/kqKg5xrAlJQ Date: Fri, 21 Nov 2014 12:28:34 +0000 Message-ID: <1ED644BD7E0A5F4091CF203DAFB8E4CC01D9D8EB@SHSMSX101.ccr.corp.intel.com> References: <1416557231-2732-1-git-send-email-zhida.zang@intel.com> In-Reply-To: <1416557231-2732-1-git-send-email-zhida.zang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3] i40e: fixed tx packets stats bug 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: Fri, 21 Nov 2014 12:18:23 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of zhida zang > Sent: Friday, November 21, 2014 4:07 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v3] i40e: fixed tx packets stats bug >=20 > v3 changes: > -updated commit log > -fixed the bug that stats data can't be cleared >=20 > Signed-off-by: Zhida Zang > --- > lib/librte_pmd_i40e/i40e_ethdev.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) >=20 > diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c > b/lib/librte_pmd_i40e/i40e_ethdev.c > index 4b7a827..c1ea37e 100644 > --- a/lib/librte_pmd_i40e/i40e_ethdev.c > +++ b/lib/librte_pmd_i40e/i40e_ethdev.c > @@ -1102,6 +1102,7 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct > rte_eth_stats *stats) > struct i40e_hw *hw =3D I40E_DEV_PRIVATE_TO_HW(dev->data- > >dev_private); > struct i40e_hw_port_stats *ns =3D &pf->stats; /* new stats */ > struct i40e_hw_port_stats *os =3D &pf->stats_offset; /* old stats */ > + struct i40e_eth_stats *ves =3D &pf->main_vsi->eth_stats; /* vsi stats *= / >=20 > /* Get statistics of struct i40e_eth_stats */ > i40e_stat_update_48(hw, I40E_GLPRT_GORCH(hw->port), @@ -1277,15 > +1278,18 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_st= ats > *stats) > /* GLPRT_MSPDC not supported */ > /* GLPRT_XEC not supported */ >=20 > - pf->offset_loaded =3D true; > - > if (pf->main_vsi) > i40e_update_vsi_stats(pf->main_vsi); >=20 > stats->ipackets =3D ns->eth.rx_unicast + ns->eth.rx_multicast + > ns->eth.rx_broadcast; > - stats->opackets =3D ns->eth.tx_unicast + ns->eth.tx_multicast + > + if (pf->offset_loaded) > + stats->opackets =3D ves->tx_unicast + ves->tx_multicast + > + ves->tx_broadcast; > + else > + stats->opackets =3D ns->eth.tx_unicast + ns->eth.tx_multicast + > ns->eth.tx_broadcast; > + pf->offset_loaded =3D true; > stats->ibytes =3D ns->eth.rx_bytes; > stats->obytes =3D ns->eth.tx_bytes; > stats->oerrors =3D ns->eth.tx_errors; > -- > 1.9.3 Acked-by: Jijiang Liu