Commit 90d2c056 authored by Mitch Williams's avatar Mitch Williams Committed by David S. Miller

i40e/i40evf: set AQ count after memory allocation

The standard way to check if the AQ is enabled is to look at the
count field. So we should only set this field after we have
successfully allocated memory. To do otherwise is to incite
panic among the populace.
Signed-off-by: default avatarMitch Williams <mitch.a.williams@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 855591d2
...@@ -386,7 +386,6 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw) ...@@ -386,7 +386,6 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw)
hw->aq.asq.next_to_use = 0; hw->aq.asq.next_to_use = 0;
hw->aq.asq.next_to_clean = 0; hw->aq.asq.next_to_clean = 0;
hw->aq.asq.count = hw->aq.num_asq_entries;
/* allocate the ring memory */ /* allocate the ring memory */
ret_code = i40e_alloc_adminq_asq_ring(hw); ret_code = i40e_alloc_adminq_asq_ring(hw);
...@@ -404,6 +403,7 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw) ...@@ -404,6 +403,7 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw)
goto init_adminq_free_rings; goto init_adminq_free_rings;
/* success! */ /* success! */
hw->aq.asq.count = hw->aq.num_asq_entries;
goto init_adminq_exit; goto init_adminq_exit;
init_adminq_free_rings: init_adminq_free_rings:
...@@ -445,7 +445,6 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw) ...@@ -445,7 +445,6 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw)
hw->aq.arq.next_to_use = 0; hw->aq.arq.next_to_use = 0;
hw->aq.arq.next_to_clean = 0; hw->aq.arq.next_to_clean = 0;
hw->aq.arq.count = hw->aq.num_arq_entries;
/* allocate the ring memory */ /* allocate the ring memory */
ret_code = i40e_alloc_adminq_arq_ring(hw); ret_code = i40e_alloc_adminq_arq_ring(hw);
...@@ -463,6 +462,7 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw) ...@@ -463,6 +462,7 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw)
goto init_adminq_free_rings; goto init_adminq_free_rings;
/* success! */ /* success! */
hw->aq.arq.count = hw->aq.num_arq_entries;
goto init_adminq_exit; goto init_adminq_exit;
init_adminq_free_rings: init_adminq_free_rings:
......
...@@ -373,7 +373,6 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw) ...@@ -373,7 +373,6 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw)
hw->aq.asq.next_to_use = 0; hw->aq.asq.next_to_use = 0;
hw->aq.asq.next_to_clean = 0; hw->aq.asq.next_to_clean = 0;
hw->aq.asq.count = hw->aq.num_asq_entries;
/* allocate the ring memory */ /* allocate the ring memory */
ret_code = i40e_alloc_adminq_asq_ring(hw); ret_code = i40e_alloc_adminq_asq_ring(hw);
...@@ -391,6 +390,7 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw) ...@@ -391,6 +390,7 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw)
goto init_adminq_free_rings; goto init_adminq_free_rings;
/* success! */ /* success! */
hw->aq.asq.count = hw->aq.num_asq_entries;
goto init_adminq_exit; goto init_adminq_exit;
init_adminq_free_rings: init_adminq_free_rings:
...@@ -432,7 +432,6 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw) ...@@ -432,7 +432,6 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw)
hw->aq.arq.next_to_use = 0; hw->aq.arq.next_to_use = 0;
hw->aq.arq.next_to_clean = 0; hw->aq.arq.next_to_clean = 0;
hw->aq.arq.count = hw->aq.num_arq_entries;
/* allocate the ring memory */ /* allocate the ring memory */
ret_code = i40e_alloc_adminq_arq_ring(hw); ret_code = i40e_alloc_adminq_arq_ring(hw);
...@@ -450,6 +449,7 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw) ...@@ -450,6 +449,7 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw)
goto init_adminq_free_rings; goto init_adminq_free_rings;
/* success! */ /* success! */
hw->aq.arq.count = hw->aq.num_arq_entries;
goto init_adminq_exit; goto init_adminq_exit;
init_adminq_free_rings: init_adminq_free_rings:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment