Skip to content

Commit 98b9e48

Browse files
Greg RoseJeff Kirsher
authored andcommitted
ixgbevf: Check if EOP has changed before using it
There is a chance that between the time EOP is read and the time it is used another transmit on a different CPU could have run and completed, thus leaving EOP in a bad state. Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent dc22129 commit 98b9e48

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ static bool ixgbevf_clean_tx_irq(struct ixgbevf_adapter *adapter,
203203
(count < tx_ring->work_limit)) {
204204
bool cleaned = false;
205205
rmb(); /* read buffer_info after eop_desc */
206+
/* eop could change between read and DD-check */
207+
if (unlikely(eop != tx_ring->tx_buffer_info[i].next_to_watch))
208+
goto cont_loop;
206209
for ( ; !cleaned; count++) {
207210
struct sk_buff *skb;
208211
tx_desc = IXGBE_TX_DESC_ADV(*tx_ring, i);
@@ -232,6 +235,7 @@ static bool ixgbevf_clean_tx_irq(struct ixgbevf_adapter *adapter,
232235
i = 0;
233236
}
234237

238+
cont_loop:
235239
eop = tx_ring->tx_buffer_info[i].next_to_watch;
236240
eop_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop);
237241
}

0 commit comments

Comments
 (0)