i40e/i40evf: add ASQ write back timeout variable to AQ structure
authorKamil Krawczyk <kamil.krawczyk@intel.com>
Wed, 4 Jun 2014 20:41:43 +0000 (20:41 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 1 Jul 2014 06:46:15 +0000 (23:46 -0700)
Add new variable defining ASQ command write back timeout to allow for
dynamic modification of this timeout. Initialize it on AQ initialize
routine with default value, vary it on device ID.

Change-ID: I5c9908f9d7c5455634353b694a986d6f146d1b9d
Signed-off-by: Kamil Krawczyk <kamil.krawczyk@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_adminq.c
drivers/net/ethernet/intel/i40e/i40e_adminq.h
drivers/net/ethernet/intel/i40evf/i40e_adminq.c
drivers/net/ethernet/intel/i40evf/i40e_adminq.h

index a8244a54b5dd5ef9c4924441769a5f79d05e5f07..2708bcdddd41a6c4bb7f3b8ff08e33a20d15c665 100644 (file)
@@ -571,6 +571,9 @@ i40e_status i40e_init_adminq(struct i40e_hw *hw)
        /* Set up register offsets */
        i40e_adminq_init_regs(hw);
 
+       /* setup ASQ command write back timeout */
+       hw->aq.asq_cmd_timeout = I40E_ASQ_CMD_TIMEOUT;
+
        /* allocate the ASQ */
        ret_code = i40e_init_asq(hw);
        if (ret_code)
@@ -860,7 +863,7 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw,
                        /* ugh! delay while spin_lock */
                        udelay(delay_len);
                        total_delay += delay_len;
-               } while (total_delay <  I40E_ASQ_CMD_TIMEOUT);
+               } while (total_delay <  hw->aq.asq_cmd_timeout);
        }
 
        /* if ready, copy the desc back to temp */
index c6142ba3a10d77b249fcc5ffe502b4b63926f1c1..bb76be1d38f73643fbdc78c413822d38bac441ff 100644 (file)
@@ -84,6 +84,7 @@ struct i40e_arq_event_info {
 struct i40e_adminq_info {
        struct i40e_adminq_ring arq;    /* receive queue */
        struct i40e_adminq_ring asq;    /* send queue */
+       u32 asq_cmd_timeout;            /* send queue cmd write back timeout*/
        u16 num_arq_entries;            /* receive queue depth */
        u16 num_asq_entries;            /* send queue depth */
        u16 arq_buf_size;               /* receive queue buffer size */
index c277763bcac00681d5dc56c145f650e4884e2e81..cc4b6db10b0444eb3e991151a28c0531fffd0d07 100644 (file)
@@ -567,6 +567,9 @@ i40e_status i40evf_init_adminq(struct i40e_hw *hw)
        /* Set up register offsets */
        i40e_adminq_init_regs(hw);
 
+       /* setup ASQ command write back timeout */
+       hw->aq.asq_cmd_timeout = I40E_ASQ_CMD_TIMEOUT;
+
        /* allocate the ASQ */
        ret_code = i40e_init_asq(hw);
        if (ret_code)
@@ -814,7 +817,7 @@ i40e_status i40evf_asq_send_command(struct i40e_hw *hw,
                        /* ugh! delay while spin_lock */
                        udelay(delay_len);
                        total_delay += delay_len;
-               } while (total_delay <  I40E_ASQ_CMD_TIMEOUT);
+               } while (total_delay <  hw->aq.asq_cmd_timeout);
        }
 
        /* if ready, copy the desc back to temp */
index 933537564d95453421def56fc1f7551a8db97eda..162845589bf7ab1673a2c87b37bd47499d1e7c4f 100644 (file)
@@ -84,6 +84,7 @@ struct i40e_arq_event_info {
 struct i40e_adminq_info {
        struct i40e_adminq_ring arq;    /* receive queue */
        struct i40e_adminq_ring asq;    /* send queue */
+       u32 asq_cmd_timeout;            /* send queue cmd write back timeout*/
        u16 num_arq_entries;            /* receive queue depth */
        u16 num_asq_entries;            /* send queue depth */
        u16 arq_buf_size;               /* receive queue buffer size */