aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ixl/i40e_adminq.c
diff options
context:
space:
mode:
authorEric Joyner <erj@FreeBSD.org>2016-05-12 18:20:18 +0000
committerEric Joyner <erj@FreeBSD.org>2016-05-12 18:20:18 +0000
commit7f70bec62338523830975427ba20827d8d002c6f (patch)
treecc54e7a4cea57e5a71301e07d8e6d5f21762e1c8 /sys/dev/ixl/i40e_adminq.c
parent223d846d93fe4f04cae073df1bee6554b35a3dc7 (diff)
downloadsrc-7f70bec62338523830975427ba20827d8d002c6f.tar.gz
src-7f70bec62338523830975427ba20827d8d002c6f.zip
ixl: Update to 1.4.9-k.
Changes by author: Kamil Krawczyk i40e-shared: use explicit cast from u16 to u8 Anjali Singhai Jain i40e-shared: Add a Virtchnl offload for RSS PCTYPE V2 Eric Joyner ixl: Remove HP device IDs. Jesse Brandeburg i40e-shared: add small bit of debug Mitch Williams i40e-shared: check for stopped admin queue Mitch Williams i40e-shared: set aq count after memory allocation Jesse Brandeburg i40e-shared: remove forever unused ID Eric Joyner ixl: Fix bug where RSS does not hash to more than 16 queues. Shannon Nelson i40e-shared: define function capabilities in only one place Eric Joyner ixl: Change spacing, comments, and a single error message. Eric Joyner ixl: Save admin queue phy interrupt mask as a define. Eric Joyner ixl: Move callout_reset() to later in init_locked(), and stop clearing OACTIVE in driver flags. Eric Joyner ixl: Add new reset+build flow to init() if it detects that the admin queue is stopped. Eric Joyner ixl: Return EACCES instead of EPERM when an nvmupdate command fails. Eric Joyner ixl: Remove KX_A device ID. Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation
Notes
Notes: svn path=/head/; revision=299548
Diffstat (limited to 'sys/dev/ixl/i40e_adminq.c')
-rw-r--r--sys/dev/ixl/i40e_adminq.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/ixl/i40e_adminq.c b/sys/dev/ixl/i40e_adminq.c
index 32f571ee3499..cc1be99ba219 100644
--- a/sys/dev/ixl/i40e_adminq.c
+++ b/sys/dev/ixl/i40e_adminq.c
@@ -400,7 +400,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);
@@ -418,6 +417,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:
@@ -459,7 +459,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);
@@ -477,6 +476,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:
@@ -996,6 +996,13 @@ enum i40e_status_code i40e_clean_arq_element(struct i40e_hw *hw,
/* take the lock before we start messing with the ring */
i40e_acquire_spinlock(&hw->aq.arq_spinlock);
+ if (hw->aq.arq.count == 0) {
+ i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
+ "AQRX: Admin queue not initialized.\n");
+ ret_code = I40E_ERR_QUEUE_EMPTY;
+ goto clean_arq_element_err;
+ }
+
/* set next_to_use to head */
if (!i40e_is_vf(hw))
ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK);
@@ -1062,6 +1069,7 @@ clean_arq_element_out:
/* Set pending if needed, unlock and return */
if (pending != NULL)
*pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc);
+clean_arq_element_err:
i40e_release_spinlock(&hw->aq.arq_spinlock);
if (i40e_is_nvm_update_op(&e->desc)) {