• Alan Brady's avatar
    i40e/i40evf: use SW variables for hang detection · 04d41051
    Alan Brady authored
    The i40e_detect_recover_hung function uses the i40e_get_tx_pending
    function to determine if there are packets stalled on the ring.
    i40e_get_tx_pending calculates the pending packets using the head
    writeback value and HW tail.  If the queue is stopped and we lose the
    interrupt to update our next_to_clean then we a) won't get another
    interrupt to clean because queue is stopped b) we won't catch the
    problem with i40e_detect_recover_hung because the HW values look like
    there's no packets waiting to be transmitted.  Using the SW values we
    can catch the issue because next_to_clean will be out of sync with head
    writeback.
    
    This has the added benefit being less CPU intensive because we don't
    need to reach into the hardware to get the values.
    Signed-off-by: default avatarAlan Brady <alan.brady@intel.com>
    Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    04d41051
i40e_txrx.h 19.2 KB