]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e: reduce wait time for adminq command completion
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 13 Apr 2017 08:45:49 +0000 (04:45 -0400)
committerJack Vogel <jack.vogel@oracle.com>
Tue, 10 Oct 2017 21:15:23 +0000 (14:15 -0700)
When sending an adminq command, we wait for the command to complete in
a loop. This loop waits for an entire millisecond, when in practice the
adminq command is processed often much faster.

Change the loop to use i40e_usec_delay instead, and wait for 50 usecs
each time instead. This appears to be about the minimum time required,
based on some manual observation and testing.

The primary benefit of this change is reducing latency of various
operations in the PF driver, especially when related to having a large
number of VFs enabled.

For example, on Linux, when instantiating 128 VFs, the time to finish
the operation dropped from about 9 seconds down to under 6 seconds.
Additionally, the time it takes to finish a PF reset with 128 VFs
dropped from 5.1 seconds down to 0.7 seconds.

As the examples above show, a significant portion of the delay is wasted
waiting for admiqn operations which have already finished.

This patch shouldn't cause impact to functionality, as we still check
and keep waiting until the command does get processed. The only expected
change is an increase in CPU utilization as we now check for completion
far more times. However, in practice the commands appear to generally be
complete within the first delay window anyways.

Change-ID: If8af8388e100da0a14eaf9e1af3afadf73a958cf
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Orabug: 26785018
(cherry picked from commit 9e3f23f44f3294f794802e3fee2ba03214451a95)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Kyle Fortin <kyle.fortin@oracle.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 c425b706f58f83e75f7a36cbd15484195036cadf..360398ce11b2e126c8135fe6319ac942fd065dd0 100644 (file)
@@ -850,8 +850,8 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw,
                         */
                        if (i40e_asq_done(hw))
                                break;
-                       usleep_range(1000, 2000);
-                       total_delay++;
+                       udelay(50);
+                       total_delay += 50;
                } while (total_delay < hw->aq.asq_cmd_timeout);
        }
 
index d92aad38afdc5fb0669e3f9d58329685e2af4644..2349fbe04bd251322a93b6c968afac519ad0564b 100644 (file)
@@ -151,7 +151,7 @@ static inline int i40e_aq_rc_to_posix(int aq_ret, int aq_rc)
 
 /* general information */
 #define I40E_AQ_LARGE_BUF      512
-#define I40E_ASQ_CMD_TIMEOUT   250  /* msecs */
+#define I40E_ASQ_CMD_TIMEOUT   250000  /* usecs */
 
 void i40e_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc,
                                       u16 opcode);
index 6b2311adbe7fd8bc0a6098d68bee369319f1d21e..3fbe3d782a2df73ae9855603cc8336edc9d81421 100644 (file)
@@ -797,8 +797,8 @@ i40e_status i40evf_asq_send_command(struct i40e_hw *hw,
                         */
                        if (i40evf_asq_done(hw))
                                break;
-                       usleep_range(1000, 2000);
-                       total_delay++;
+                       udelay(50);
+                       total_delay += 50;
                } while (total_delay < hw->aq.asq_cmd_timeout);
        }
 
index 1f9b3b5d946d3e02ee1aff52d1671feaa7195b2c..e0bfaa3d4a21341efc4bcddf2b23290e9492a5e6 100644 (file)
@@ -151,7 +151,7 @@ static inline int i40e_aq_rc_to_posix(int aq_ret, int aq_rc)
 
 /* general information */
 #define I40E_AQ_LARGE_BUF      512
-#define I40E_ASQ_CMD_TIMEOUT   250  /* msecs */
+#define I40E_ASQ_CMD_TIMEOUT   250000  /* usecs */
 
 void i40evf_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc,
                                       u16 opcode);