Commit c1ddf1f5 authored by Brett Creeley's avatar Brett Creeley Committed by Jeff Kirsher

ice: Use the software based tail when checking for hung Tx ring

Currently in ice_get_tx_pending we try to read a Tx ring's tail. This is
then compared with the software based head (next_to_clean) to determine
if we have pending work. This will never work because reading of the Tx
ring's tail is no longer supported. Fix this by using the software based
tail (next_to_use) to determine if there is pending work.
Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 932630fa
...@@ -41,12 +41,12 @@ static void ice_update_pf_stats(struct ice_pf *pf); ...@@ -41,12 +41,12 @@ static void ice_update_pf_stats(struct ice_pf *pf);
* ice_get_tx_pending - returns number of Tx descriptors not processed * ice_get_tx_pending - returns number of Tx descriptors not processed
* @ring: the ring of descriptors * @ring: the ring of descriptors
*/ */
static u32 ice_get_tx_pending(struct ice_ring *ring) static u16 ice_get_tx_pending(struct ice_ring *ring)
{ {
u32 head, tail; u16 head, tail;
head = ring->next_to_clean; head = ring->next_to_clean;
tail = readl(ring->tail); tail = ring->next_to_use;
if (head != tail) if (head != tail)
return (head < tail) ? return (head < tail) ?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment