aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/i40evf/i40e_adminq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/intel/i40evf/i40e_adminq.c')
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40e_adminq.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_adminq.c b/drivers/net/ethernet/intel/i40evf/i40e_adminq.c
index f08450b90774..929d47152bf2 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_adminq.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_adminq.c
@@ -887,6 +887,13 @@ i40e_status i40evf_clean_arq_element(struct i40e_hw *hw,
887 /* take the lock before we start messing with the ring */ 887 /* take the lock before we start messing with the ring */
888 mutex_lock(&hw->aq.arq_mutex); 888 mutex_lock(&hw->aq.arq_mutex);
889 889
890 if (hw->aq.arq.count == 0) {
891 i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
892 "AQRX: Admin queue not initialized.\n");
893 ret_code = I40E_ERR_QUEUE_EMPTY;
894 goto clean_arq_element_err;
895 }
896
890 /* set next_to_use to head */ 897 /* set next_to_use to head */
891 ntu = (rd32(hw, hw->aq.arq.head) & I40E_VF_ARQH1_ARQH_MASK); 898 ntu = (rd32(hw, hw->aq.arq.head) & I40E_VF_ARQH1_ARQH_MASK);
892 if (ntu == ntc) { 899 if (ntu == ntc) {
@@ -948,6 +955,8 @@ clean_arq_element_out:
948 /* Set pending if needed, unlock and return */ 955 /* Set pending if needed, unlock and return */
949 if (pending != NULL) 956 if (pending != NULL)
950 *pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc); 957 *pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc);
958
959clean_arq_element_err:
951 mutex_unlock(&hw->aq.arq_mutex); 960 mutex_unlock(&hw->aq.arq_mutex);
952 961
953 return ret_code; 962 return ret_code;