From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 9C27F2E81; Thu, 24 Jan 2019 15:19:56 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jan 2019 06:19:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,516,1539673200"; d="scan'208";a="138416185" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 24 Jan 2019 06:19:55 -0800 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 24 Jan 2019 06:19:55 -0800 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 24 Jan 2019 06:19:54 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.150]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.239]) with mapi id 14.03.0415.000; Thu, 24 Jan 2019 22:19:52 +0800 From: "Zhang, Qi Z" To: "Sun, Chenmin" , "dev@dpdk.org" CC: "stable@dpdk.org" Thread-Topic: [PATCH] net/i40e: fix statistics Thread-Index: AQHUsx/95kMkBls4VkOfm3/IfywfiKW+dEzg Date: Thu, 24 Jan 2019 14:19:52 +0000 Message-ID: <039ED4275CED7440929022BC67E706115332169D@SHSMSX103.ccr.corp.intel.com> References: <20190123133003.3527-1-chenmin.sun@intel.com> In-Reply-To: <20190123133003.3527-1-chenmin.sun@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjgxNmMwYTMtZTIzMy00ZjY5LWI2MTYtMDQ3YzYzNzU3ZWU1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRTJDVFFJZ2VMa2h4dWtRTGt1Q1Y2U2d2VHhqbThaNkV6SlhleWJEMlBSbGtRNGVGd1VEYnJFb3dkVnFDZE5XNiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action 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-stable] [PATCH] net/i40e: fix statistics X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 14:19:57 -0000 > -----Original Message----- > From: Sun, Chenmin > Sent: Wednesday, January 23, 2019 9:30 PM > To: dev@dpdk.org > Cc: stable@dpdk.org; Sun, Chenmin ; Zhang, Qi Z > > Subject: [PATCH] net/i40e: fix statistics >=20 > From: Chenmin Sun >=20 > 1. Fix the lldp stop condition check - for firmware versions 6.01(for X71= 0)/3.33(for > X722) or later we need stop the lldp 2. Doucment known issue for tx bytes > decreasing due to link status chage s/Doucment/Document s/chage/change Also add 3. deferred stats reset in dev_init to avoid some noise be counted. >=20 > Fixes: 044846f071cc ("net/i40e: stop LLDP before setting local LLDP MIB") > Cc: stable@dpdk.org > Cc: qi.z.zhang@intel.com >=20 > Signed-off-by: Chenmin Sun Acked-by: Qi Zhang Applied into dpdk-next-net-intel with above commit log change and below min= or fix. Thanks Qi > --- > doc/guides/nics/i40e.rst | 7 +++++++ > drivers/net/i40e/i40e_ethdev.c | 38 +++++++++++++++++++++++++++------- > 2 files changed, 37 insertions(+), 8 deletions(-) >=20 > diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst index > 6aceb53ea..d9ec07e12 100644 > --- a/doc/guides/nics/i40e.rst > +++ b/doc/guides/nics/i40e.rst > @@ -698,3 +698,10 @@ See :numref:`figure_intel_perf_test_setup` for the > performance test setup. > * Start creating a stream on packet generator. >=20 > * Set the Ethernet II type to 0x0800. > + > +Tx bytes affected by the link status change > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + > +For firmware versions prior to 6.01 for X710 series and 3.33 for X722 > +series, the tx_bytes statsistics data is affected by the link down event= . Each s/statsistics/statistics > time the link status changes to down, the tx_bytes decreases 110 bytes. > + Empty line at end of file > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index a6b97e164..181efbac0 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -1493,9 +1493,6 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void > *init_params __rte_unused) > goto err_setup_pf_switch; > } >=20 > - /* reset all stats of the device, including pf and main vsi */ > - i40e_dev_stats_reset(dev); > - > vsi =3D pf->main_vsi; >=20 > /* Disable double vlan by default */ > @@ -1590,6 +1587,9 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void > *init_params __rte_unused) > memset(&pf->rss_info, 0, > sizeof(struct i40e_rte_flow_rss_conf)); >=20 > + /* reset all stats of the device, including pf and main vsi */ > + i40e_dev_stats_reset(dev); > + > return 0; >=20 > err_init_fdir_filter_list: > @@ -3454,12 +3454,38 @@ i40e_fw_version_get(struct rte_eth_dev *dev, char > *fw_version, size_t fw_size) > ver, build, patch); >=20 > ret +=3D 1; /* add the size of '\0' */ > + Unnecessary change. > if (fw_size < (u32)ret) > return ret; > else > return 0; > } >=20 > +/* > + * When using NVM 6.01(for X710 XL710 XXV710)/3.33(for X722) or later, > + * the Rx data path does not hang if the FW LLDP is stopped. > + * return true if lldp need to stop > + * return false if we cannot disable the LLDP to avoid Rx data path bloc= king. > + */ > +static bool > +i40e_need_stop_lldp(struct rte_eth_dev *dev) { > + double nvm_ver; > + char ver_str[64] =3D {0}; > + struct i40e_hw *hw =3D > I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); > + > + i40e_fw_version_get(dev, ver_str, 64); > + nvm_ver =3D atof(ver_str); > + if ((hw->mac.type =3D=3D I40E_MAC_X722 || > + hw->mac.type =3D=3D I40E_MAC_X722_VF) && > + ((uint32_t)(nvm_ver * 1000) >=3D (uint32_t)(3.33 * 1000))) > + return true; > + else if ((uint32_t)(nvm_ver * 1000) >=3D (uint32_t)(6.01 * 1000)) > + return true; > + > + return false; > +} > + > static void > i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info > *dev_info) { @@ -11425,11 +11451,7 @@ i40e_dcb_init_configure(struct > rte_eth_dev *dev, bool sw_dcb) > * LLDP MIB change event. > */ > if (sw_dcb =3D=3D TRUE) { > - /* When using NVM 6.01 or later, the RX data path does > - * not hang if the FW LLDP is stopped. > - */ > - if (((hw->nvm.version >> 12) & 0xf) >=3D 6 && > - ((hw->nvm.version >> 4) & 0xff) >=3D 1) { > + if (i40e_need_stop_lldp(dev)) { > ret =3D i40e_aq_stop_lldp(hw, TRUE, NULL); > if (ret !=3D I40E_SUCCESS) > PMD_INIT_LOG(DEBUG, "Failed to stop lldp"); > -- > 2.17.1