Skip to content

Commit 7c7710d

Browse files
bcreeley13smb49
authored andcommitted
iavf: Fix cached head and tail value for iavf_get_tx_pending
BugLink: https://bugs.launchpad.net/bugs/1993203 [ Upstream commit 809f23c ] The underlying hardware may or may not allow reading of the head or tail registers and it really makes no difference if we use the software cached values. So, always used the software cached values. Fixes: 9c6c125 ("i40e: Detection and recovery of TX queue hung logic moved to service_task from tx_timeout") Signed-off-by: Brett Creeley <[email protected]> Co-developed-by: Norbert Zulinski <[email protected]> Signed-off-by: Norbert Zulinski <[email protected]> Signed-off-by: Mateusz Palczewski <[email protected]> Tested-by: Konrad Jankowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]> Signed-off-by: Stefan Bader <[email protected]>
1 parent d8b2f86 commit 7c7710d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/intel/iavf/iavf_txrx.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,11 @@ u32 iavf_get_tx_pending(struct iavf_ring *ring, bool in_sw)
114114
{
115115
u32 head, tail;
116116

117+
/* underlying hardware might not allow access and/or always return
118+
* 0 for the head/tail registers so just use the cached values
119+
*/
117120
head = ring->next_to_clean;
118-
tail = readl(ring->tail);
121+
tail = ring->next_to_use;
119122

120123
if (head != tail)
121124
return (head < tail) ?

0 commit comments

Comments
 (0)