OSDN Git Service

ice: manage interrupts during poll exit
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Wed, 31 Mar 2021 21:16:58 +0000 (14:16 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 15 Apr 2021 00:00:05 +0000 (17:00 -0700)
The driver would occasionally miss that there were outstanding
descriptors to clean when exiting busy/napi poll. This issue has
been in the code since the introduction of the ice driver.

Attempt to "catch" any remaining work by triggering a software
interrupt when exiting napi poll or busy-poll. This will not
cause extra interrupts in the case of normal execution.

This issue was found when running sfnt-pingpong, with busy
poll enabled, and typically with larger I/O sizes like > 8192,
the program would occasionally report > 1 second maximums
to complete a ping pong.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_hw_autogen.h
drivers/net/ethernet/intel/ice/ice_txrx.c

index 67b5b9b..de38a0f 100644 (file)
 #define GLINT_DYN_CTL_ITR_INDX_M               ICE_M(0x3, 3)
 #define GLINT_DYN_CTL_INTERVAL_S               5
 #define GLINT_DYN_CTL_INTERVAL_M               ICE_M(0xFFF, 5)
+#define GLINT_DYN_CTL_SW_ITR_INDX_ENA_M                BIT(24)
 #define GLINT_DYN_CTL_SW_ITR_INDX_M            ICE_M(0x3, 25)
 #define GLINT_DYN_CTL_WB_ON_ITR_M              BIT(30)
 #define GLINT_DYN_CTL_INTENA_MSK_M             BIT(31)
index 97c3efb..1ce9ad0 100644 (file)
@@ -1302,6 +1302,7 @@ static u32 ice_buildreg_itr(u16 itr_idx, u16 itr)
 static void ice_update_ena_itr(struct ice_q_vector *q_vector)
 {
        struct ice_vsi *vsi = q_vector->vsi;
+       bool wb_en = q_vector->wb_on_itr;
        u32 itr_val;
 
        if (test_bit(ICE_DOWN, vsi->state))
@@ -1310,7 +1311,7 @@ static void ice_update_ena_itr(struct ice_q_vector *q_vector)
        /* When exiting WB_ON_ITR, let ITR resume its normal
         * interrupts-enabled path.
         */
-       if (q_vector->wb_on_itr)
+       if (wb_en)
                q_vector->wb_on_itr = false;
 
        /* This will do nothing if dynamic updates are not enabled. */
@@ -1318,6 +1319,16 @@ static void ice_update_ena_itr(struct ice_q_vector *q_vector)
 
        /* net_dim() updates ITR out-of-band using a work item */
        itr_val = ice_buildreg_itr(ICE_ITR_NONE, 0);
+       /* trigger an immediate software interrupt when exiting
+        * busy poll, to make sure to catch any pending cleanups
+        * that might have been missed due to interrupt state
+        * transition.
+        */
+       if (wb_en) {
+               itr_val |= GLINT_DYN_CTL_SWINT_TRIG_M |
+                          GLINT_DYN_CTL_SW_ITR_INDX_M |
+                          GLINT_DYN_CTL_SW_ITR_INDX_ENA_M;
+       }
        wr32(&vsi->back->hw, GLINT_DYN_CTL(q_vector->reg_idx), itr_val);
 }