aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ixl/i40e_adminq.c
diff options
context:
space:
mode:
authorEric Joyner <erj@FreeBSD.org>2016-05-12 18:18:55 +0000
committerEric Joyner <erj@FreeBSD.org>2016-05-12 18:18:55 +0000
commitac83ea833d494a651c3fa807c90675b724a78c19 (patch)
treed5eab245e3761a8856554d0c9dcc805571cab5ca /sys/dev/ixl/i40e_adminq.c
parent3934bc5561de24ea02938e73890c309e67ccac5f (diff)
downloadsrc-ac83ea833d494a651c3fa807c90675b724a78c19.tar.gz
src-ac83ea833d494a651c3fa807c90675b724a78c19.zip
ixl: Update to 1.4.5-k.
This first update will revert some upstream changes; forthcoming updates will reinstate them. Changes, by author: Anjali Singhai Jain i40e-shared: Add WB_ON_ITR offload support Shannon Nelson i40e-shared: fix phy_types bitmap type Kevin Scott i40e-shared: Store off PHY capabilities Shannon Nelson i40e-shared: fix byteswap of phy_type Jingjing Wu i40e-shared: Fix compile issue related to const string Greg Bowers i40e-shared: Add AQ defines for non-willing Apps (DCB) Greg Bowers i40e-shared: Support for non-willing Apps (DCB) Shannon Nelson i40e-shared: use upper-32 bit macro for address Shannon Nelson i40e-shared: grab the AQ spinlocks before clearing registers Eric Joyner ixl: Properly strip out X722_SUPPORT (temporarily). Eric Joyner ixl: Allow Fort Pond devices to advertise 100M in set_advertise sysctl. 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=299545
Diffstat (limited to 'sys/dev/ixl/i40e_adminq.c')
-rw-r--r--sys/dev/ixl/i40e_adminq.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/sys/dev/ixl/i40e_adminq.c b/sys/dev/ixl/i40e_adminq.c
index 5eacdc4e31a5..32f571ee3499 100644
--- a/sys/dev/ixl/i40e_adminq.c
+++ b/sys/dev/ixl/i40e_adminq.c
@@ -496,8 +496,12 @@ enum i40e_status_code i40e_shutdown_asq(struct i40e_hw *hw)
{
enum i40e_status_code ret_code = I40E_SUCCESS;
- if (hw->aq.asq.count == 0)
- return I40E_ERR_NOT_READY;
+ i40e_acquire_spinlock(&hw->aq.asq_spinlock);
+
+ if (hw->aq.asq.count == 0) {
+ ret_code = I40E_ERR_NOT_READY;
+ goto shutdown_asq_out;
+ }
/* Stop firmware AdminQ processing */
wr32(hw, hw->aq.asq.head, 0);
@@ -506,16 +510,13 @@ enum i40e_status_code i40e_shutdown_asq(struct i40e_hw *hw)
wr32(hw, hw->aq.asq.bal, 0);
wr32(hw, hw->aq.asq.bah, 0);
- /* make sure spinlock is available */
- i40e_acquire_spinlock(&hw->aq.asq_spinlock);
-
hw->aq.asq.count = 0; /* to indicate uninitialized queue */
/* free ring buffers */
i40e_free_asq_bufs(hw);
+shutdown_asq_out:
i40e_release_spinlock(&hw->aq.asq_spinlock);
-
return ret_code;
}
@@ -529,8 +530,12 @@ enum i40e_status_code i40e_shutdown_arq(struct i40e_hw *hw)
{
enum i40e_status_code ret_code = I40E_SUCCESS;
- if (hw->aq.arq.count == 0)
- return I40E_ERR_NOT_READY;
+ i40e_acquire_spinlock(&hw->aq.arq_spinlock);
+
+ if (hw->aq.arq.count == 0) {
+ ret_code = I40E_ERR_NOT_READY;
+ goto shutdown_arq_out;
+ }
/* Stop firmware AdminQ processing */
wr32(hw, hw->aq.arq.head, 0);
@@ -539,16 +544,13 @@ enum i40e_status_code i40e_shutdown_arq(struct i40e_hw *hw)
wr32(hw, hw->aq.arq.bal, 0);
wr32(hw, hw->aq.arq.bah, 0);
- /* make sure spinlock is available */
- i40e_acquire_spinlock(&hw->aq.arq_spinlock);
-
hw->aq.arq.count = 0; /* to indicate uninitialized queue */
/* free ring buffers */
i40e_free_arq_bufs(hw);
+shutdown_arq_out:
i40e_release_spinlock(&hw->aq.arq_spinlock);
-
return ret_code;
}
@@ -773,21 +775,23 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
u16 retval = 0;
u32 val = 0;
+ i40e_acquire_spinlock(&hw->aq.asq_spinlock);
+
hw->aq.asq_last_status = I40E_AQ_RC_OK;
- val = rd32(hw, hw->aq.asq.head);
- if (val >= hw->aq.num_asq_entries) {
+ if (hw->aq.asq.count == 0) {
i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
- "AQTX: head overrun at %d\n", val);
+ "AQTX: Admin queue not initialized.\n");
status = I40E_ERR_QUEUE_EMPTY;
- goto asq_send_command_exit;
+ goto asq_send_command_error;
}
- if (hw->aq.asq.count == 0) {
+ val = rd32(hw, hw->aq.asq.head);
+ if (val >= hw->aq.num_asq_entries) {
i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
- "AQTX: Admin queue not initialized.\n");
+ "AQTX: head overrun at %d\n", val);
status = I40E_ERR_QUEUE_EMPTY;
- goto asq_send_command_exit;
+ goto asq_send_command_error;
}
details = I40E_ADMINQ_DETAILS(hw->aq.asq, hw->aq.asq.next_to_use);
@@ -817,8 +821,6 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
desc->flags &= ~CPU_TO_LE16(details->flags_dis);
desc->flags |= CPU_TO_LE16(details->flags_ena);
- i40e_acquire_spinlock(&hw->aq.asq_spinlock);
-
if (buff_size > hw->aq.asq_buf_size) {
i40e_debug(hw,
I40E_DEBUG_AQ_MESSAGE,
@@ -948,7 +950,6 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
asq_send_command_error:
i40e_release_spinlock(&hw->aq.asq_spinlock);
-asq_send_command_exit:
return status;
}