From patchwork Mon Dec 2 07:48:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaolong Ye X-Patchwork-Id: 63443 X-Patchwork-Delegate: xiaolong.ye@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5AD1EA04B5; Mon, 2 Dec 2019 09:00:13 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0607F1BFAC; Mon, 2 Dec 2019 08:58:20 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 7A6A48F96 for ; Mon, 2 Dec 2019 08:58:13 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Dec 2019 23:58:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,268,1571727600"; d="scan'208";a="207993416" Received: from dpdk_yexl_af_xdp.sh.intel.com ([10.67.119.186]) by fmsmga008.fm.intel.com with ESMTP; 01 Dec 2019 23:58:12 -0800 From: Xiaolong Ye To: Beilei Xing , Qi Zhang Cc: dev@dpdk.org, Xiaolong Ye , Maciej Paczkowski Date: Mon, 2 Dec 2019 15:48:41 +0800 Message-Id: <20191202074935.97629-16-xiaolong.ye@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191202074935.97629-1-xiaolong.ye@intel.com> References: <20191202074935.97629-1-xiaolong.ye@intel.com> Subject: [dpdk-dev] [PATCH 15/69] net/i40e/base: revert ShadowRAM checksum calculation change X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The reason of this revert is unexpected issue found in NVM Update tool in Linux, ESX and FreeBSD during NVM image downgrade. The implementation is no longer needed since the QV tools are already aware of new FW double ShadowRAM dump mechanism. Signed-off-by: Maciej Paczkowski Reviewed-by: Aleksandr Loktionov Reviewed-by: Galazka Krzysztof Signed-off-by: Xiaolong Ye --- drivers/net/i40e/base/i40e_nvm.c | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/drivers/net/i40e/base/i40e_nvm.c b/drivers/net/i40e/base/i40e_nvm.c index 8c94b6072..c8b401cdd 100644 --- a/drivers/net/i40e/base/i40e_nvm.c +++ b/drivers/net/i40e/base/i40e_nvm.c @@ -676,38 +676,16 @@ enum i40e_status_code i40e_calc_nvm_checksum(struct i40e_hw *hw, u16 *checksum) enum i40e_status_code i40e_update_nvm_checksum(struct i40e_hw *hw) { enum i40e_status_code ret_code = I40E_SUCCESS; - u16 checksum, checksum_sr; + u16 checksum; __le16 le_sum; DEBUGFUNC("i40e_update_nvm_checksum"); ret_code = i40e_calc_nvm_checksum(hw, &checksum); - if (ret_code) - return ret_code; - le_sum = CPU_TO_LE16(checksum); - ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD, - 1, &le_sum, true); - if (ret_code) - return ret_code; - - /* Due to changes in FW the SW is required to perform double SR-dump - * in some cases. SR-dump is the process when internal shadow RAM is - * dumped into flash bank. It is triggered by setting "last_command" - * argument in i40e_write_nvm_aq function call. - * Since FW 1.8 we need to calculate SR checksum again and update it - * in flash if it is not equal to previously computed checksum. - * This situation would occur only in FW >= 1.8 - */ - ret_code = i40e_calc_nvm_checksum(hw, &checksum_sr); - if (ret_code) - return ret_code; - if (checksum_sr != checksum) { - le_sum = CPU_TO_LE16(checksum_sr); - ret_code = i40e_write_nvm_aq(hw, 0x00, - I40E_SR_SW_CHECKSUM_WORD, + if (ret_code == I40E_SUCCESS) + ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD, 1, &le_sum, true); - } return ret_code; }