i40e/base: set AQ count after memory allocation

The standard way to check if the AQ is enabled is to look at
the count field. So it should only set this field after it has
successfully allocated memory.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
This commit is contained in:
Helin Zhang 2016-03-08 16:14:15 +08:00 committed by Thomas Monjalon
parent 9f44dd3d8a
commit 4a08159e6e

View File

@ -431,7 +431,6 @@ enum i40e_status_code i40e_init_asq(struct i40e_hw *hw)
hw->aq.asq.next_to_use = 0;
hw->aq.asq.next_to_clean = 0;
hw->aq.asq.count = hw->aq.num_asq_entries;
/* allocate the ring memory */
ret_code = i40e_alloc_adminq_asq_ring(hw);
@ -449,6 +448,7 @@ enum i40e_status_code i40e_init_asq(struct i40e_hw *hw)
goto init_adminq_free_rings;
/* success! */
hw->aq.asq.count = hw->aq.num_asq_entries;
goto init_adminq_exit;
init_adminq_free_rings:
@ -490,7 +490,6 @@ enum i40e_status_code i40e_init_arq(struct i40e_hw *hw)
hw->aq.arq.next_to_use = 0;
hw->aq.arq.next_to_clean = 0;
hw->aq.arq.count = hw->aq.num_arq_entries;
/* allocate the ring memory */
ret_code = i40e_alloc_adminq_arq_ring(hw);
@ -508,6 +507,7 @@ enum i40e_status_code i40e_init_arq(struct i40e_hw *hw)
goto init_adminq_free_rings;
/* success! */
hw->aq.arq.count = hw->aq.num_arq_entries;
goto init_adminq_exit;
init_adminq_free_rings: