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 5BB3D7FF9 for ; Mon, 24 Nov 2014 04:50:04 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 23 Nov 2014 20:00:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,446,1413270000"; d="scan'208";a="612875626" Received: from pgsmsx102.gar.corp.intel.com ([10.221.44.80]) by orsmga001.jf.intel.com with ESMTP; 23 Nov 2014 20:00:47 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by PGSMSX102.gar.corp.intel.com (10.221.44.80) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 24 Nov 2014 12:00:46 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.182]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.86]) with mapi id 14.03.0195.001; Mon, 24 Nov 2014 12:00:45 +0800 From: "Zhang, Helin" To: "Zang, Zhida" , "Liu, Jijiang" Thread-Topic: [dpdk-dev] [PATCH v3] i40e: fixed tx packets stats bug Thread-Index: AQHQBWK4IWchLg44HkO2Qx4GJ2g5NpxvK0CA Date: Mon, 24 Nov 2014 04:00:45 +0000 Message-ID: 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 Cc: "dev@dpdk.org" 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: Mon, 24 Nov 2014 03:50:04 -0000 Hi Zhida Please rework your patch and send a new version according to the comments f= rom Thomas! Commit log was missed in your patch. Regards, Helin > -----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