OSDN Git Service

i40e/i40evf: use SW variables for hang detection
authorAlan Brady <alan.brady@intel.com>
Mon, 12 Feb 2018 14:16:59 +0000 (09:16 -0500)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 26 Feb 2018 20:33:27 +0000 (12:33 -0800)
commit04d4105174349dceccf9545a3e5e421c18f2cc56
tree72b598ef1d8f56760acd7892d0c7daa56e99f548
parent8cd5fe62cc5a2aca1c698c28baa46ac6931ba11f
i40e/i40evf: use SW variables for hang detection

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: Alan Brady <alan.brady@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40e/i40e_txrx.h
drivers/net/ethernet/intel/i40evf/i40e_txrx.c