DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: fix send admin queue command before init
@ 2018-09-28  3:20 Qi Zhang
  2018-09-28  6:10 ` Xing, Beilei
  0 siblings, 1 reply; 3+ messages in thread
From: Qi Zhang @ 2018-09-28  3:20 UTC (permalink / raw)
  To: beilei.xing
  Cc: dev, ferruh.yigit, jingjing.wu, anand.rawat, ranjit.menon,
	Qi Zhang, stable

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: Rawat Anand <anand.rawat@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 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 24d73f2ff..5c20733b8 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -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,
-- 
2.13.6

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: fix send admin queue command before init
  2018-09-28  3:20 [dpdk-dev] [PATCH] net/i40e: fix send admin queue command before init Qi Zhang
@ 2018-09-28  6:10 ` Xing, Beilei
  2018-09-29  2:08   ` Zhang, Qi Z
  0 siblings, 1 reply; 3+ messages in thread
From: Xing, Beilei @ 2018-09-28  6:10 UTC (permalink / raw)
  To: Zhang, Qi Z
  Cc: dev, Yigit, Ferruh, Wu, Jingjing, Rawat, Anand, Menon, Ranjit, stable



> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Friday, September 28, 2018 11:20 AM
> To: Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Rawat, Anand <anand.rawat@intel.com>; Menon,
> Ranjit <ranjit.menon@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> stable@dpdk.org
> 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.
> 
> Fixes: b6a0ec418274 ("i40e: use AQ for Rx control register read/write")
> Cc: stable@dpdk.org
> 
> Reported-by: Rawat Anand <anand.rawat@intel.com>
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>

Acked-by: Beilei Xing <beilei.xing@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: fix send admin queue command before init
  2018-09-28  6:10 ` Xing, Beilei
@ 2018-09-29  2:08   ` Zhang, Qi Z
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Qi Z @ 2018-09-29  2:08 UTC (permalink / raw)
  To: Xing, Beilei
  Cc: dev, Yigit, Ferruh, Wu, Jingjing, Rawat, Anand, Menon, Ranjit, stable



> -----Original Message-----
> From: Xing, Beilei
> Sent: Friday, September 28, 2018 2:11 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Rawat, Anand <anand.rawat@intel.com>; Menon,
> Ranjit <ranjit.menon@intel.com>; stable@dpdk.org
> Subject: RE: [PATCH] net/i40e: fix send admin queue command before init
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, Qi Z
> > Sent: Friday, September 28, 2018 11:20 AM
> > To: Xing, Beilei <beilei.xing@intel.com>
> > Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Wu, Jingjing
> > <jingjing.wu@intel.com>; Rawat, Anand <anand.rawat@intel.com>; Menon,
> > Ranjit <ranjit.menon@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> > stable@dpdk.org
> > 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.
> >
> > Fixes: b6a0ec418274 ("i40e: use AQ for Rx control register
> > read/write")
> > Cc: stable@dpdk.org
> >
> > Reported-by: Rawat Anand <anand.rawat@intel.com>
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> 
> Acked-by: Beilei Xing <beilei.xing@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-29  2:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-28  3:20 [dpdk-dev] [PATCH] net/i40e: fix send admin queue command before init Qi Zhang
2018-09-28  6:10 ` Xing, Beilei
2018-09-29  2:08   ` Zhang, Qi Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).