Skip to contentSkip to conversation

iavf: Fix cached head and tail value for iavf_get_tx_pending

PATCH In review Mateusz Palczewski 2 participants 2 messages Sep 1, 2022 – Sep 7, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 iavf: Fix cached head and tail value for iavf_get_tx_pending

From: Brett Creeley <[email protected]>

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 9c6c12595b73 ("i40e: Detection and recovery of TX queue hung logic moved to service_task from tx_timeout")

---
v2: Added missing sign-off tag

---
 drivers/net/ethernet/intel/iavf/iavf_txrx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/iavf/iavf_txrx.c +4 -1
index 06d18797d25a..4c3f3f419110 100644
@@ -114,8 +114,11 @@ u32 iavf_get_tx_pending(struct iavf_ring *ring, bool in_sw)
 {
 	u32 head, tail;
 
+	/* underlying hardware might not allow access and/or always return
+	 * 0 for the head/tail registers so just use the cached values
+	 */
 	head = ring->next_to_clean;
-	tail = readl(ring->tail);
+	tail = ring->next_to_use;
 
 	if (head != tail)
 		return (head < tail) ?
Signature · 6 lines
2.27.0

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Tested-by on v2 1/1
#1 lore raw

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

Quoted 35 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Mateusz Palczewski
Sent: Thursday, September 1, 2022 4:35 PM
To: [email protected]
Cc: Brett Creeley <[email protected]>; Zulinski, NorbertX <[email protected]>
Subject: [Intel-wired-lan] [PATCH net v2] iavf: Fix cached head and tail value for iavf_get_tx_pending

From: Brett Creeley <[email protected]>

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 9c6c12595b73 ("i40e: Detection and recovery of TX queue hung logic

moved to service_task from tx_timeout")

---
v2: Added missing sign-off tag

---
 drivers/net/ethernet/intel/iavf/iavf_txrx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/iavf/iavf_txrx.c +0 -0
index 06d18797d25a..4c3f3f419110 100644

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan