Skip to contentSkip to conversation

net/i40e: fix send admin queue command before init

PATCH In review Qi Zhang 2 participants 3 messages Sep 28, 2018 – Sep 29, 2018 Network drivers

lore
Share & tools
lore

Qi Zhang

author
#0 lore raw

PATCH 1/1 net/i40e: fix send admin queue command before init

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")
---
 drivers/net/i40e/i40e_ethdev.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)
drivers/net/i40e/i40e_ethdev.c +17 -17
index 24d73f2ff..5c20733b8 100644
@@ -1270,9 +1270,6 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
 	/* 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) {
@@ -1287,6 +1284,23 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
 		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);
@@ -1302,20 +1316,6 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
 	/* 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_global_register(hw,
Signature · 1 line
2.13.6
Acked-by on v1 1/1
#1 lore raw
Quoted 16 lines

-----Original Message-----
From: Zhang, Qi Z
Sent: Friday, September 28, 2018 11:20 AM
To: Xing, Beilei <[email protected]>
Cc: [email protected]; Yigit, Ferruh <[email protected]>; Wu, Jingjing <[email protected]>; Rawat, Anand <[email protected]>; Menon, Ranjit <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Subject: [PATCH] net/i40e: fix send admin queue command before init

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.

Quoted 7 lines

The patch fixes the issue by proper reordering.

Fixes b6a0ec418274 ("i40e: use AQ for Rx control register read/write")
author Applied
#2 lore raw
Quoted 29 lines

-----Original Message-----
From: Xing, Beilei
Sent: Friday, September 28, 2018 2:11 PM
To: Zhang, Qi Z <[email protected]>
Cc: [email protected]; Yigit, Ferruh <[email protected]>; Wu, Jingjing <[email protected]>; Rawat, Anand <[email protected]>; Menon, Ranjit <[email protected]>; [email protected]
Subject: RE: [PATCH] net/i40e: fix send admin queue command before init

Quoted 16 lines

-----Original Message-----
From: Zhang, Qi Z
Sent: Friday, September 28, 2018 11:20 AM
To: Xing, Beilei <[email protected]>
Cc: [email protected]; Yigit, Ferruh <[email protected]>; Wu, Jingjing <[email protected]>; Rawat, Anand <[email protected]>; Menon, Ranjit <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Subject: [PATCH] net/i40e: fix send admin queue command before init

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.

Quoted 8 lines
Quoted 6 lines
Fixes b6a0ec418274 ("i40e: use AQ for Rx control register

read/write")
Cc: [email protected]

Applied to dpdk-next-net-intel.

Thanks
Qi