From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id F2DD61B52A for ; Thu, 7 Feb 2019 14:28:40 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4E5CD2D4B75; Thu, 7 Feb 2019 13:28:40 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.33.36.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3630F600C4; Thu, 7 Feb 2019 13:28:39 +0000 (UTC) From: Kevin Traynor To: Chenmin Sun Cc: Qi Zhang , dpdk stable Date: Thu, 7 Feb 2019 13:26:05 +0000 Message-Id: <20190207132614.20538-59-ktraynor@redhat.com> In-Reply-To: <20190207132614.20538-1-ktraynor@redhat.com> References: <20190207132614.20538-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 07 Feb 2019 13:28:40 +0000 (UTC) Subject: [dpdk-stable] patch 'net/i40e: fix statistics' has been queued to LTS release 18.11.1 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, 07 Feb 2019 13:28:41 -0000 Hi, FYI, your patch has been queued to LTS release 18.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/14/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Kevin Traynor --- >>From 81714c8347638c6c01b66f1bf8ecd1bb809d421f Mon Sep 17 00:00:00 2001 From: Chenmin Sun Date: Wed, 23 Jan 2019 21:30:03 +0800 Subject: [PATCH] net/i40e: fix statistics [ upstream commit 866000d94939c44c5e8cbc8d1624300dae16c21a ] 1. Fix the lldp stop condition check - for firmware versions 6.01(for X710)/3.33(for X722) or later we need stop the lldp 2. deferred stats reset in dev_init to avoid some noise be counted. 3. Document known issue for tx bytes decreasing due to link status change Fixes: 044846f071cc ("net/i40e: stop LLDP before setting local LLDP MIB") Signed-off-by: Chenmin Sun Acked-by: Qi Zhang --- doc/guides/nics/i40e.rst | 6 ++++++ drivers/net/i40e/i40e_ethdev.c | 37 ++++++++++++++++++++++++++-------- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst index bfacbd117..40bf0f140 100644 --- a/doc/guides/nics/i40e.rst +++ b/doc/guides/nics/i40e.rst @@ -696,2 +696,8 @@ See :numref:`figure_intel_perf_test_setup` for the performance test setup. * 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 statistics data is affected by +the link down event. Each time the link status changes to down, the tx_bytes decreases 110 bytes. diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index f97cd5348..dca61f03a 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1494,7 +1494,4 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused) } - /* reset all stats of the device, including pf and main vsi */ - i40e_dev_stats_reset(dev); - vsi = pf->main_vsi; @@ -1591,4 +1588,7 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused) sizeof(struct i40e_rte_flow_rss_conf)); + /* reset all stats of the device, including pf and main vsi */ + i40e_dev_stats_reset(dev); + return 0; @@ -3461,4 +3461,29 @@ i40e_fw_version_get(struct rte_eth_dev *dev, char *fw_version, size_t fw_size) } +/* + * 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 blocking. + */ +static bool +i40e_need_stop_lldp(struct rte_eth_dev *dev) +{ + double nvm_ver; + char ver_str[64] = {0}; + struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); + + i40e_fw_version_get(dev, ver_str, 64); + nvm_ver = atof(ver_str); + if ((hw->mac.type == I40E_MAC_X722 || + hw->mac.type == I40E_MAC_X722_VF) && + ((uint32_t)(nvm_ver * 1000) >= (uint32_t)(3.33 * 1000))) + return true; + else if ((uint32_t)(nvm_ver * 1000) >= (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) @@ -11428,9 +11453,5 @@ i40e_dcb_init_configure(struct rte_eth_dev *dev, bool sw_dcb) */ if (sw_dcb == 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) >= 6 && - ((hw->nvm.version >> 4) & 0xff) >= 1) { + if (i40e_need_stop_lldp(dev)) { ret = i40e_aq_stop_lldp(hw, TRUE, NULL); if (ret != I40E_SUCCESS) -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-02-07 13:19:56.977694243 +0000 +++ 0059-net-i40e-fix-statistics.patch 2019-02-07 13:19:55.000000000 +0000 @@ -1,15 +1,16 @@ -From 866000d94939c44c5e8cbc8d1624300dae16c21a Mon Sep 17 00:00:00 2001 +From 81714c8347638c6c01b66f1bf8ecd1bb809d421f Mon Sep 17 00:00:00 2001 From: Chenmin Sun Date: Wed, 23 Jan 2019 21:30:03 +0800 Subject: [PATCH] net/i40e: fix statistics +[ upstream commit 866000d94939c44c5e8cbc8d1624300dae16c21a ] + 1. Fix the lldp stop condition check - for firmware versions 6.01(for X710)/3.33(for X722) or later we need stop the lldp 2. deferred stats reset in dev_init to avoid some noise be counted. 3. Document known issue for tx bytes decreasing due to link status change Fixes: 044846f071cc ("net/i40e: stop LLDP before setting local LLDP MIB") -Cc: stable@dpdk.org Signed-off-by: Chenmin Sun Acked-by: Qi Zhang @@ -19,10 +20,10 @@ 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst -index 53bc02495..9680a92a9 100644 +index bfacbd117..40bf0f140 100644 --- a/doc/guides/nics/i40e.rst +++ b/doc/guides/nics/i40e.rst -@@ -705,2 +705,8 @@ See :numref:`figure_intel_perf_test_setup` for the performance test setup. +@@ -696,2 +696,8 @@ See :numref:`figure_intel_perf_test_setup` for the performance test setup. * Set the Ethernet II type to 0x0800. +