From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 481611B518 for ; Fri, 30 Nov 2018 00:13:41 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 30 Nov 2018 01:19:34 +0200 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id wATNCW7d032075; Fri, 30 Nov 2018 01:13:38 +0200 From: Yongseok Koh To: Qi Zhang Cc: Anand Rawat , Beilei Xing , dpdk stable Date: Thu, 29 Nov 2018 15:10:33 -0800 Message-Id: <20181129231202.30436-39-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181129231202.30436-1-yskoh@mellanox.com> References: <20181129231202.30436-1-yskoh@mellanox.com> Subject: [dpdk-stable] patch 'net/i40e: fix send admin queue command before init' has been queued to LTS release 17.11.5 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, 29 Nov 2018 23:13:41 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/01/18. 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. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Yongseok --- >>From e0794e91afa05bd2c22e99dedb8fcf7870a69ace Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Fri, 28 Sep 2018 11:20:01 +0800 Subject: [PATCH] net/i40e: fix send admin queue command before init [ upstream commit 0a1b657838c2c0546ebc6469ed2840c5a9a796f4 ] We should not issue Admin Queue command before Admin Queue is initialized. But this happened in i40e_hw_init and i40e_filter_input_set_init. The patch fixes the issue by proper reordering. Fixes: b6a0ec418274 ("i40e: use AQ for Rx control register read/write") Reported-by: Anand Rawat Signed-off-by: Qi Zhang Acked-by: Beilei Xing --- drivers/net/i40e/i40e_ethdev.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 711c6e7b6..9d99e841e 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1224,9 +1224,6 @@ eth_i40e_dev_init(struct rte_eth_dev *dev) /* Make sure all is clean before doing PF reset */ i40e_clear_hw(hw); - /* Initialize the hardware */ - i40e_hw_init(dev); - /* Reset here to make sure all is clean for each PF */ ret = i40e_pf_reset(hw); if (ret) { @@ -1241,6 +1238,23 @@ eth_i40e_dev_init(struct rte_eth_dev *dev) return ret; } + /* Initialize the parameters for adminq */ + i40e_init_adminq_parameter(hw); + ret = i40e_init_adminq(hw); + if (ret != I40E_SUCCESS) { + PMD_INIT_LOG(ERR, "Failed to init adminq: %d", ret); + return -EIO; + } + PMD_INIT_LOG(INFO, "FW %d.%d API %d.%d NVM %02d.%02d.%02d eetrack %04x", + hw->aq.fw_maj_ver, hw->aq.fw_min_ver, + hw->aq.api_maj_ver, hw->aq.api_min_ver, + ((hw->nvm.version >> 12) & 0xf), + ((hw->nvm.version >> 4) & 0xff), + (hw->nvm.version & 0xf), hw->nvm.eetrack); + + /* Initialize the hardware */ + i40e_hw_init(dev); + i40e_config_automask(pf); i40e_set_default_pctype_table(dev); @@ -1257,20 +1271,6 @@ eth_i40e_dev_init(struct rte_eth_dev *dev) /* Initialize the input set for filters (hash and fd) to default value */ i40e_filter_input_set_init(pf); - /* Initialize the parameters for adminq */ - i40e_init_adminq_parameter(hw); - ret = i40e_init_adminq(hw); - if (ret != I40E_SUCCESS) { - PMD_INIT_LOG(ERR, "Failed to init adminq: %d", ret); - return -EIO; - } - PMD_INIT_LOG(INFO, "FW %d.%d API %d.%d NVM %02d.%02d.%02d eetrack %04x", - hw->aq.fw_maj_ver, hw->aq.fw_min_ver, - hw->aq.api_maj_ver, hw->aq.api_min_ver, - ((hw->nvm.version >> 12) & 0xf), - ((hw->nvm.version >> 4) & 0xff), - (hw->nvm.version & 0xf), hw->nvm.eetrack); - /* initialise the L3_MAP register */ if (!pf->support_multi_driver) { ret = i40e_aq_debug_write_register(hw, I40E_GLQF_L3_MAP(40), -- 2.11.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-29 15:01:46.965643032 -0800 +++ 0039-net-i40e-fix-send-admin-queue-command-before-init.patch 2018-11-29 15:01:45.068959000 -0800 @@ -1,15 +1,16 @@ -From 0a1b657838c2c0546ebc6469ed2840c5a9a796f4 Mon Sep 17 00:00:00 2001 +From e0794e91afa05bd2c22e99dedb8fcf7870a69ace Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Fri, 28 Sep 2018 11:20:01 +0800 Subject: [PATCH] net/i40e: fix send admin queue command before init +[ upstream commit 0a1b657838c2c0546ebc6469ed2840c5a9a796f4 ] + We should not issue Admin Queue command before Admin Queue is initialized. But this happened in i40e_hw_init and i40e_filter_input_set_init. The patch fixes the issue by proper reordering. Fixes: b6a0ec418274 ("i40e: use AQ for Rx control register read/write") -Cc: stable@dpdk.org Reported-by: Anand Rawat Signed-off-by: Qi Zhang @@ -19,10 +20,10 @@ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c -index de25de650..9225333d0 100644 +index 711c6e7b6..9d99e841e 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c -@@ -1332,9 +1332,6 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused) +@@ -1224,9 +1224,6 @@ eth_i40e_dev_init(struct rte_eth_dev *dev) /* Make sure all is clean before doing PF reset */ i40e_clear_hw(hw); @@ -32,7 +33,7 @@ /* Reset here to make sure all is clean for each PF */ ret = i40e_pf_reset(hw); if (ret) { -@@ -1349,6 +1346,23 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused) +@@ -1241,6 +1238,23 @@ eth_i40e_dev_init(struct rte_eth_dev *dev) return ret; } @@ -56,7 +57,7 @@ i40e_config_automask(pf); i40e_set_default_pctype_table(dev); -@@ -1364,20 +1378,6 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused) +@@ -1257,20 +1271,6 @@ eth_i40e_dev_init(struct rte_eth_dev *dev) /* Initialize the input set for filters (hash and fd) to default value */ i40e_filter_input_set_init(pf); @@ -76,7 +77,7 @@ - /* initialise the L3_MAP register */ if (!pf->support_multi_driver) { - ret = i40e_aq_debug_write_global_register(hw, + ret = i40e_aq_debug_write_register(hw, I40E_GLQF_L3_MAP(40), -- 2.11.0