i40e/base: enhance adminq init and ASQ send
authorHelin Zhang <helin.zhang@intel.com>
Thu, 30 Apr 2015 15:03:25 +0000 (23:03 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Sun, 17 May 2015 21:17:26 +0000 (23:17 +0200)
The timeout of ASQ command is enlarged from 100 ms to 250 ms to
wait longer time for the response. nvm_busy is not needed anymore.
Also nvm_release_on_done and nvmupd_state will be set during
adminq init.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
lib/librte_pmd_i40e/i40e/i40e_adminq.c
lib/librte_pmd_i40e/i40e/i40e_adminq.h

index 7fd20f9..8f9e870 100644 (file)
@@ -563,7 +563,6 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)
        u16 eetrack_lo, eetrack_hi;
        int retry = 0;
 #endif
-
        /* verify input for valid configuration */
        if ((hw->aq.num_arq_entries == 0) ||
            (hw->aq.num_asq_entries == 0) ||
@@ -634,7 +633,8 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)
 
        /* pre-emptive resource lock release */
        i40e_aq_release_resource(hw, I40E_NVM_RESOURCE_ID, 0, NULL);
-       hw->aq.nvm_busy = false;
+       hw->aq.nvm_release_on_done = false;
+       hw->nvmupd_state = I40E_NVMUPD_STATE_INIT;
 
        ret_code = i40e_aq_set_hmc_resource_profile(hw,
                                                    I40E_HMC_PROFILE_DEFAULT,
@@ -779,14 +779,6 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
                goto asq_send_command_exit;
        }
 
-#ifdef PF_DRIVER
-       if (i40e_is_nvm_update_op(desc) && hw->aq.nvm_busy) {
-               i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQTX: NVM busy.\n");
-               status = I40E_ERR_NVM;
-               goto asq_send_command_exit;
-       }
-
-#endif
        details = I40E_ADMINQ_DETAILS(hw->aq.asq, hw->aq.asq.next_to_use);
        if (cmd_details) {
                i40e_memcpy(details,
@@ -938,11 +930,6 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
                status = I40E_ERR_ADMIN_QUEUE_TIMEOUT;
        }
 
-#ifdef PF_DRIVER
-       if (!status && i40e_is_nvm_update_op(desc))
-               hw->aq.nvm_busy = true;
-
-#endif /* PF_DRIVER */
 asq_send_command_error:
        i40e_release_spinlock(&hw->aq.asq_spinlock);
 asq_send_command_exit:
@@ -996,9 +983,6 @@ enum i40e_status_code i40e_clean_arq_element(struct i40e_hw *hw,
        ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK);
        if (ntu == ntc) {
                /* nothing to do - shouldn't need to update ring's values */
-               i40e_debug(hw,
-                          I40E_DEBUG_AQ_MESSAGE,
-                          "AQRX: Queue is empty.\n");
                ret_code = I40E_ERR_ADMIN_QUEUE_NO_WORK;
                goto clean_arq_element_out;
        }
@@ -1062,7 +1046,6 @@ clean_arq_element_out:
 
 #ifdef PF_DRIVER
        if (i40e_is_nvm_update_op(&e->desc)) {
-               hw->aq.nvm_busy = false;
                if (hw->aq.nvm_release_on_done) {
                        i40e_release_nvm(hw);
                        hw->aq.nvm_release_on_done = false;
index 3c88bb4..410d07e 100644 (file)
@@ -103,7 +103,6 @@ struct i40e_adminq_info {
        u32 fw_build;                   /* firmware build number */
        u16 api_maj_ver;                /* api major version */
        u16 api_min_ver;                /* api minor version */
-       bool nvm_busy;
        bool nvm_release_on_done;
 
        struct i40e_spinlock asq_spinlock; /* Send queue spinlock */
@@ -157,7 +156,7 @@ STATIC inline int i40e_aq_rc_to_posix(int aq_ret, u16 aq_rc)
 
 /* general information */
 #define I40E_AQ_LARGE_BUF              512
-#define I40E_ASQ_CMD_TIMEOUT           100  /* msecs */
+#define I40E_ASQ_CMD_TIMEOUT           250  /* msecs */
 
 void i40e_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc,
                                       u16 opcode);