|
@@ -708,16 +708,22 @@ void i40e_free_tx_resources(struct i40e_ring *tx_ring)
|
|
|
/**
|
|
|
* i40e_get_tx_pending - how many tx descriptors not processed
|
|
|
* @tx_ring: the ring of descriptors
|
|
|
+ * @in_sw: use SW variables
|
|
|
*
|
|
|
* Since there is no access to the ring head register
|
|
|
* in XL710, we need to use our local copies
|
|
|
**/
|
|
|
-u32 i40e_get_tx_pending(struct i40e_ring *ring)
|
|
|
+u32 i40e_get_tx_pending(struct i40e_ring *ring, bool in_sw)
|
|
|
{
|
|
|
u32 head, tail;
|
|
|
|
|
|
- head = i40e_get_head(ring);
|
|
|
- tail = readl(ring->tail);
|
|
|
+ if (!in_sw) {
|
|
|
+ head = i40e_get_head(ring);
|
|
|
+ tail = readl(ring->tail);
|
|
|
+ } else {
|
|
|
+ head = ring->next_to_clean;
|
|
|
+ tail = ring->next_to_use;
|
|
|
+ }
|
|
|
|
|
|
if (head != tail)
|
|
|
return (head < tail) ?
|
|
@@ -774,7 +780,7 @@ void i40e_detect_recover_hung(struct i40e_vsi *vsi)
|
|
|
*/
|
|
|
smp_rmb();
|
|
|
tx_ring->tx_stats.prev_pkt_ctr =
|
|
|
- i40e_get_tx_pending(tx_ring) ? packets : -1;
|
|
|
+ i40e_get_tx_pending(tx_ring, true) ? packets : -1;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -898,7 +904,7 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,
|
|
|
* them to be written back in case we stay in NAPI.
|
|
|
* In this mode on X722 we do not enable Interrupt.
|
|
|
*/
|
|
|
- unsigned int j = i40e_get_tx_pending(tx_ring);
|
|
|
+ unsigned int j = i40e_get_tx_pending(tx_ring, false);
|
|
|
|
|
|
if (budget &&
|
|
|
((j / WB_STRIDE) == 0) && (j > 0) &&
|